From: <gem...@li...> - 2012-02-07 15:17:56
|
Revision: 458 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=458&view=rev Author: mennodekker Date: 2012-02-07 15:17:46 +0000 (Tue, 07 Feb 2012) Log Message: ----------- Fixed recalc problem: always saving the completion time, even when it was the same as before Modified Paths: -------------- branches/1.5.x/library/classes/Gems/Tracker/Token.php Modified: branches/1.5.x/library/classes/Gems/Tracker/Token.php =================================================================== --- branches/1.5.x/library/classes/Gems/Tracker/Token.php 2012-02-07 11:24:23 UTC (rev 457) +++ branches/1.5.x/library/classes/Gems/Tracker/Token.php 2012-02-07 15:17:46 UTC (rev 458) @@ -349,6 +349,8 @@ //Set completion time for completion event if ($setCompletionTime) { $values['gto_completion_time'] = $complTime->toString(Gems_Tracker::DB_DATETIME_FORMAT); + //Save the old value + $originalCompletionTime = $this->_gemsData['gto_completion_time']; $this->_gemsData['gto_completion_time'] = $values['gto_completion_time']; } @@ -364,8 +366,8 @@ } if ($setCompletionTime) { - //Make sure to unset otherwise it won't get saved - $this->_gemsData['gto_completion_time'] = null; + //Reset to old value, so changes will be picked up + $this->_gemsData['gto_completion_time'] = $originalCompletionTime; } $values['gto_duration_in_sec'] = max($complTime->diffSeconds($startTime), 0); @@ -1233,4 +1235,4 @@ public function cacheSet($key, $value) { $this->_cache[$key] = $value; } -} +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |