testData: Fix moving of test results

This commit is contained in:
Alexander Nicolaysen Sørnes
2008-03-02 23:19:28 +01:00
committed by Chris Morgan
parent f7a1e181cd
commit 498a2bd4b0

View File

@@ -190,12 +190,7 @@ class testData{
if($oNewVersion->objectGetState() == 'accepted' && $this->sState == 'pending') if($oNewVersion->objectGetState() == 'accepted' && $this->sState == 'pending')
$this->sState = 'queued'; $this->sState = 'queued';
if($this->sState == 'accepted') $bUpdateRatingInfo = true;
{
$oOldVersion = new version($oOldTest->iVersionId);
$oOldVersion->updateRatingInfo();
$oNewVersion->updateRatingInfo();
}
} }
if(query_parameters("UPDATE testResults SET if(query_parameters("UPDATE testResults SET
@@ -227,7 +222,14 @@ class testData{
$this->iTestingId)) $this->iTestingId))
{ {
if($bUpdateRatingInfo && $this->sState == 'accepted') if($bUpdateRatingInfo && $this->sState == 'accepted')
{
if($this->iVersionId != $oOldTest->iVersionId)
{
$oNewVersion = new version($this->iVersionId);
$oNewVersion->updateRatingInfo();
}
$oVersion->updateRatingInfo(); $oVersion->updateRatingInfo();
}
if(!$bSilent) if(!$bSilent)
$this->SendNotificationMail("edit", $sWhatChanged); $this->SendNotificationMail("edit", $sWhatChanged);