From e8bfc0024cb6b491e85ec83b845e34fcc44fb40c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Tue, 25 Dec 2007 20:01:00 +0100 Subject: [PATCH] Update version rating when updating test results --- include/testData.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/include/testData.php b/include/testData.php index 9b8a968..096ae65 100644 --- a/include/testData.php +++ b/include/testData.php @@ -92,6 +92,9 @@ class testData{ $this->iTestingId = query_appdb_insert_id(); $this->testData($this->iTestingId); $this->SendNotificationMail(); + + if(!$this->sState == 'accepted') + $oVersion->updateRatingInfo(); return true; } else @@ -165,24 +168,36 @@ class testData{ "$this->sRuns.\n"; } + $bUpdateRatingInfo = false; if($this->sTestedRating != $oOldTest->sTestedRating) { + $bUpdateRatingInfo = true; $sWhatChanged .= "Rating was changed from $oOldTest->sTestedRating ". "to $this->sTestedRating.\n"; } if($this->sTestedRelease != $oOldTest->sTestedRelease) { + $bUpdateRatingInfo = true; $sWhatChanged .= "Tested release was changed from ". $oOldTest->sTestedRelease." to $this->sTestedRelease.\n"; } + if($bUpdateRatingInfo && $this->sState == 'accepted') + $oVersion->updateRatingInfo(); + if($this->iVersionId != $oOldTest->iVersionId) { $sWhatChanged .= 'Moved from '.version::fullName($oOldTest->iVersionId).' to '.version::fullName($this->iVersionId)."\n"; $oNewVersion = new version($this->iVersionId); if($oNewVersion->objectGetState() == 'accepted' && $this->sState == 'pending') $this->sState = 'queued'; + + if($this->sState == 'accepted') + { + $oOldVersion->updateRatingInfo(); + $oNewVersion->updateRatingInfo(); + } } if(query_parameters("UPDATE testResults SET @@ -268,6 +283,9 @@ class testData{ return false; } + if($this->sState == 'accepted') + $oVersion->updateRatingInfo(); + return true; } @@ -299,6 +317,8 @@ class testData{ return false; } + $oVersion->updateRatingInfo(); + return true; }