mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
Stop watches - reset of deadlines + overrun
SVN:trunk[2169]
This commit is contained in:
@@ -201,15 +201,11 @@ return false;
|
|||||||
$sThresholdDesc = $oAttDef->SecondsToDate($aThresholdData['deadline']);
|
$sThresholdDesc = $oAttDef->SecondsToDate($aThresholdData['deadline']);
|
||||||
if ($aThresholdData['triggered'])
|
if ($aThresholdData['triggered'])
|
||||||
{
|
{
|
||||||
if ($aThresholdData['overrun'])
|
$sThresholdDesc .= " <b>TRIGGERED</b>";
|
||||||
{
|
}
|
||||||
$sThresholdDesc .= " <b>TRIGGERED</b>, Overrun:".(int) $aThresholdData['overrun']." seconds";
|
if ($aThresholdData['overrun'])
|
||||||
}
|
{
|
||||||
else
|
$sThresholdDesc .= " Overrun:".(int) $aThresholdData['overrun']." sec.";
|
||||||
{
|
|
||||||
// Still active, overrun unknown
|
|
||||||
$sThresholdDesc .= " <b>TRIGGERED</b>";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$aProperties[$iPercent.'%'] = $sThresholdDesc;
|
$aProperties[$iPercent.'%'] = $sThresholdDesc;
|
||||||
}
|
}
|
||||||
@@ -347,11 +343,14 @@ return false;
|
|||||||
// The threshold is in the future, reset
|
// The threshold is in the future, reset
|
||||||
$aThresholdData['passed'] = false;
|
$aThresholdData['passed'] = false;
|
||||||
$aThresholdData['triggered'] = false;
|
$aThresholdData['triggered'] = false;
|
||||||
|
$aThresholdData['overrun'] = null;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// The new threshold is in the past
|
// The new threshold is in the past
|
||||||
$aThresholdData['passed'] = true;
|
$aThresholdData['passed'] = true;
|
||||||
|
// Note: the overrun can be wrong, but the correct algorithm to compute
|
||||||
|
// the overrun of a deadline in the past requires that the ormStopWatch keeps track of all its history!!!
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -376,7 +375,6 @@ return false;
|
|||||||
{
|
{
|
||||||
if (!is_null($aThresholdData['deadline']) && (time() > $aThresholdData['deadline']))
|
if (!is_null($aThresholdData['deadline']) && (time() > $aThresholdData['deadline']))
|
||||||
{
|
{
|
||||||
$aThresholdData['passed'] = true;
|
|
||||||
if ($aThresholdData['overrun'] > 0)
|
if ($aThresholdData['overrun'] > 0)
|
||||||
{
|
{
|
||||||
// Accumulate from last start
|
// Accumulate from last start
|
||||||
@@ -388,6 +386,8 @@ return false;
|
|||||||
$iOverrun = $this->ComputeDuration($oObject, $oAttDef, $aThresholdData['deadline'], time());
|
$iOverrun = $this->ComputeDuration($oObject, $oAttDef, $aThresholdData['deadline'], time());
|
||||||
$aThresholdData['overrun'] = $iOverrun;
|
$aThresholdData['overrun'] = $iOverrun;
|
||||||
}
|
}
|
||||||
|
$aThresholdData['passed'] = true;
|
||||||
|
$aThresholdData['deadline'] = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user