From ece152173fd88a980876b0c6e6847e3cb306509c Mon Sep 17 00:00:00 2001 From: Romain Quetiez Date: Thu, 18 Dec 2014 08:37:00 +0000 Subject: [PATCH] Advanced customization: a stop watch can be started in the past (incident ticket created from an alarm) SVN:trunk[3478] --- core/ormstopwatch.class.inc.php | 11 ++++++++--- readme.txt | 5 +++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/core/ormstopwatch.class.inc.php b/core/ormstopwatch.class.inc.php index 863512ae7..eb3f24cd9 100644 --- a/core/ormstopwatch.class.inc.php +++ b/core/ormstopwatch.class.inc.php @@ -330,7 +330,7 @@ class ormStopWatch * It is the responsibility of the caller to compute the deadlines * (to avoid computing twice for the same result) */ - public function Start($oObject, $oAttDef) + public function Start($oObject, $oAttDef, $iNow = null) { if (!is_null($this->iLastStart)) { @@ -338,11 +338,16 @@ class ormStopWatch return false; } + if (is_null($iNow)) + { + $iNow = time(); + } + if (is_null($this->iStarted)) { - $this->iStarted = time(); + $this->iStarted = $iNow; } - $this->iLastStart = time(); + $this->iLastStart = $iNow; $this->iStopped = null; return true; diff --git a/readme.txt b/readme.txt index fa4d55c3d..daf112771 100644 --- a/readme.txt +++ b/readme.txt @@ -1,4 +1,4 @@ -iTop - version 2.1.0 - 16-Dec-2014 +iTop - version 2.1.0 - 16-Dec-2014 Readme file 1. ABOUT THIS RELEASE @@ -293,6 +293,8 @@ Extending the data model User rights: deny on a parent class must give DENY even if the class is explicitely ALLOW on the same profile (that was already working if the rules are given on several profiles). Added a config flag to force the legacy algorithm (user_rights_legacy, defaulting to false) #1029 Got rid of tags that were not used at all and that were really misleading extension developers #1032 When adding a case log, existing objects could not be displayed anymore! +Advanced customization: a stop watch can be started in the past (incident ticket created from an alarm) + Improved the XML format, changing from 1.0 to 1.1 - The change is ascendant compatible (automatically converted into 1.1 by ModelFactory) and thus sould be transparent: could may leave your extensions unchanged if you do not need to benefit from the new format @@ -302,7 +304,6 @@ Improved the XML format, changing from 1.0 to 1.1 - Added an id on the transitions to allow a finer granularity for the deltas. - Rework of the lifecycle/actions to ease the extensibility (Generic handlers replacing the specific ones: Rest, Copy, SetCurrentDate, SetCurrentUser, SetElapsedTime) - Internals ---------------------- Protected the property fields against the collision of ids within the same page (even if that is a bug, make it work not too bad!)