From bb9236deae67c0aa630bc0d812013fa8fac7dd97 Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Thu, 6 Apr 2017 19:07:08 +0000 Subject: [PATCH] N.816 New parameter in the working time computer GetDeadline API: the 4th parameter is the threshold for which the deadline is being computed. SVN:trunk[4675] --- core/ormstopwatch.class.inc.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/core/ormstopwatch.class.inc.php b/core/ormstopwatch.class.inc.php index f4dde0240..956a2da63 100644 --- a/core/ormstopwatch.class.inc.php +++ b/core/ormstopwatch.class.inc.php @@ -1,5 +1,5 @@ Get('working_time_computing'); if ($sWorkingTimeComputer == '') @@ -280,7 +280,7 @@ class ormStopWatch } // GetDeadline($oObject, $iDuration, DateTime $oStartDate) $oStartDate = new DateTime('@'.$iStartTime); // setTimestamp not available in PHP 5.2 - $oDeadline = call_user_func($aCallSpec, $oObject, $iDurationSec, $oStartDate); + $oDeadline = call_user_func($aCallSpec, $oObject, $iDurationSec, $oStartDate, $iPercent); $iRet = $oDeadline->format('U'); return $iRet; } @@ -384,8 +384,8 @@ class ormStopWatch $sAttCode = $oAttDef->GetCode(); WorkingTimeRecorder::Start($oObject, $iComputationRefTime, "ormStopWatch-Deadline-$iPercent-$sAttCode", 'Core:ExplainWTC:StopWatch-Deadline', array("Class:$sClass/Attribute:$sAttCode", $iPercent)); } - $aThresholdData['deadline'] = $this->ComputeDeadline($oObject, $oAttDef, $this->iLastStart, $iThresholdDuration - $this->iTimeSpent); - // OR $aThresholdData['deadline'] = $this->ComputeDeadline($oObject, $oAttDef, $this->iStarted, $iThresholdDuration); + $aThresholdData['deadline'] = $this->ComputeDeadline($oObject, $oAttDef, $iPercent, $this->iLastStart, $iThresholdDuration - $this->iTimeSpent); + // OR $aThresholdData['deadline'] = $this->ComputeDeadline($oObject, $oAttDef, $iPercent, $this->iStarted, $iThresholdDuration); if (class_exists('WorkingTimeRecorder')) {