Prechádzať zdrojové kódy

Advanced customization: a stop watch can be started in the past (incident ticket created from an alarm)

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@3478 a333f486-631f-4898-b8df-5754b55c2be0
romainq 10 rokov pred
rodič
commit
c1463924f8
2 zmenil súbory, kde vykonal 11 pridanie a 5 odobranie
  1. 8 3
      core/ormstopwatch.class.inc.php
  2. 3 2
      readme.txt

+ 8 - 3
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;

+ 3 - 2
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 <format> 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!)