Merged in dashboards2 (pull request #2060)

Dashboard/KPIs stable version
This commit is contained in:
Julio Cesar Laura Avendaño
2015-04-30 17:32:58 -04:00
11 changed files with 34 additions and 19 deletions

View File

@@ -523,10 +523,7 @@ class AppDelegation extends BaseAppDelegation
//getting the calendar
$calendar->getCalendar($row['USR_UID'], $row['PRO_UID'], $row['TAS_UID']);
$calData = $calendar->getCalendarData();
//Recalculating DueDate with the user calendar if it exist. It allways will take the derivation date like initial date.
$iDueDate = $calendar->dashCalculateDate($row['DEL_DELEGATE_DATE'], $fTaskDuration, $fTaskDurationUnit, $calData);
//if the task is not started
if ($isStarted == 0) {
if ($row['DEL_INIT_DATE'] != null && $row['DEL_INIT_DATE'] != '') {
@@ -562,7 +559,6 @@ class AppDelegation extends BaseAppDelegation
//$delDuration = $this->getDiffDate( $iFinishDate, $iInitDate );
$delDuration = $calendar->dashCalculateDurationWithCalendar($row['DEL_INIT_DATE'], $row['DEL_FINISH_DATE'], $calData );//by jen
$delDuration = $delDuration / (24 * 60 * 60); //Saving the delDuration in days. The calculateDurationSLA func returns mins.
$oAppDel->setDelDuration( $delDuration );
//calculate due date if correspond
$dueDate = strtotime($iDueDate);
@@ -592,8 +588,12 @@ class AppDelegation extends BaseAppDelegation
//we are putting negative number if the task is not delayed, and positive number for the time the task is delayed
//$delayDuration = $this->getDiffDate( $now, $iDueDate );
$delayDuration = $calendar->dashCalculateDurationWithCalendar( $iDueDate, date("Y-m-d H:i:s"), $calData );
$delayDuration = $delayDuration / (24 * 60 * 60); //Days
$delayDuration = 0;
if($now > $iDueDate){
$delayDuration = $calendar->dashCalculateDurationWithCalendar( $iDueDate, date("Y-m-d H:i:s"), $calData );
$delayDuration = $delayDuration / (24 * 60 * 60);
}
//Days
$oAppDel->setDelDelayDuration( $delayDuration );
if ($fTaskDuration != 0) {
$overduePercentage = $delayDuration / $fTaskDuration;

View File

@@ -52,6 +52,7 @@ class DashboardIndicator extends BaseDashboardIndicator
$rs = DashboardIndicatorPeer::doSelectRS( $criteria );
$rs->setFetchmode( ResultSet::FETCHMODE_ASSOC );
$dashboardIndicator = array();
while ($rs->next()) {
$row = $rs->getRow();