Update version rating when updating test results

This commit is contained in:
Alexander Nicolaysen Sørnes
2007-12-25 20:01:00 +01:00
committed by Chris Morgan
parent 9db2c4b701
commit e8bfc0024c

View File

@@ -92,6 +92,9 @@ class testData{
$this->iTestingId = query_appdb_insert_id(); $this->iTestingId = query_appdb_insert_id();
$this->testData($this->iTestingId); $this->testData($this->iTestingId);
$this->SendNotificationMail(); $this->SendNotificationMail();
if(!$this->sState == 'accepted')
$oVersion->updateRatingInfo();
return true; return true;
} }
else else
@@ -165,24 +168,36 @@ class testData{
"$this->sRuns.\n"; "$this->sRuns.\n";
} }
$bUpdateRatingInfo = false;
if($this->sTestedRating != $oOldTest->sTestedRating) if($this->sTestedRating != $oOldTest->sTestedRating)
{ {
$bUpdateRatingInfo = true;
$sWhatChanged .= "Rating was changed from $oOldTest->sTestedRating ". $sWhatChanged .= "Rating was changed from $oOldTest->sTestedRating ".
"to $this->sTestedRating.\n"; "to $this->sTestedRating.\n";
} }
if($this->sTestedRelease != $oOldTest->sTestedRelease) if($this->sTestedRelease != $oOldTest->sTestedRelease)
{ {
$bUpdateRatingInfo = true;
$sWhatChanged .= "Tested release was changed from ". $sWhatChanged .= "Tested release was changed from ".
$oOldTest->sTestedRelease." to $this->sTestedRelease.\n"; $oOldTest->sTestedRelease." to $this->sTestedRelease.\n";
} }
if($bUpdateRatingInfo && $this->sState == 'accepted')
$oVersion->updateRatingInfo();
if($this->iVersionId != $oOldTest->iVersionId) if($this->iVersionId != $oOldTest->iVersionId)
{ {
$sWhatChanged .= 'Moved from '.version::fullName($oOldTest->iVersionId).' to '.version::fullName($this->iVersionId)."\n"; $sWhatChanged .= 'Moved from '.version::fullName($oOldTest->iVersionId).' to '.version::fullName($this->iVersionId)."\n";
$oNewVersion = new version($this->iVersionId); $oNewVersion = new version($this->iVersionId);
if($oNewVersion->objectGetState() == 'accepted' && $this->sState == 'pending') if($oNewVersion->objectGetState() == 'accepted' && $this->sState == 'pending')
$this->sState = 'queued'; $this->sState = 'queued';
if($this->sState == 'accepted')
{
$oOldVersion->updateRatingInfo();
$oNewVersion->updateRatingInfo();
}
} }
if(query_parameters("UPDATE testResults SET if(query_parameters("UPDATE testResults SET
@@ -268,6 +283,9 @@ class testData{
return false; return false;
} }
if($this->sState == 'accepted')
$oVersion->updateRatingInfo();
return true; return true;
} }
@@ -299,6 +317,8 @@ class testData{
return false; return false;
} }
$oVersion->updateRatingInfo();
return true; return true;
} }