More fixes and uses for objectManager's version/testData queues

This commit is contained in:
Alexander Nicolaysen Sørnes
2007-04-21 01:02:10 +00:00
committed by WineHQ
parent dad5de17b1
commit d5aabe4d17
7 changed files with 91 additions and 34 deletions

View File

@@ -305,6 +305,9 @@ class ObjectManager
if(!$oObject->canEdit()) if(!$oObject->canEdit())
return FALSE; return FALSE;
if($this->bIsRejected)
$oObject->ReQueue();
if($this->bIsQueue) if($this->bIsQueue)
$oObject->unQueue(); $oObject->unQueue();

View File

@@ -23,7 +23,7 @@ function global_admin_menu() {
BASE."objectManager.php?sClass=maintainer&bIsQueue=true&sTitle=". BASE."objectManager.php?sClass=maintainer&bIsQueue=true&sTitle=".
"Maintainer%20Queue"); "Maintainer%20Queue");
$g->add("View Test Results Queue (".testData::objectGetEntriesCount(true, false).")", $g->add("View Test Results Queue (".testData::objectGetEntriesCount(true, false).")",
BASE."objectManager.php?sClass=testData&bIsQueue=true&sTitle=". BASE."objectManager.php?sClass=testData_queue&bIsQueue=true&sTitle=".
"Test%20Results%20Queue"); "Test%20Results%20Queue");
$g->add("View Distribution Queue (".distribution::objectGetEntriesCount(true, $g->add("View Distribution Queue (".distribution::objectGetEntriesCount(true,
false).")", false).")",
@@ -47,12 +47,12 @@ function global_admin_menu() {
BASE."objectManager.php?sClass=application&bIsQueue=true&bIsRejected=true&". BASE."objectManager.php?sClass=application&bIsQueue=true&bIsRejected=true&".
"sTitle=Rejected%20Applications"); "sTitle=Rejected%20Applications");
$g->add("View Rejected Versions (".version::objectGetEntriesCount(true, true).")", $g->add("View Rejected Versions (".version::objectGetEntriesCount(true, true).")",
BASE."objectManager.php?sClass=version&bIsQueue=true&bIsRejected=true&". BASE."objectManager.php?sClass=version_queue&bIsQueue=true&".
"sTitle=Rejected%20Versions"); "bIsRejected=true&sTitle=Rejected%20Versions");
$g->add("View Rejected Test Results (".testData::objectGetEntriesCount(true, $g->add("View Rejected Test Results (".testData::objectGetEntriesCount(true,
true).")", true).")",
BASE."objectManager.php?sClass=testData&bIsQueue=true&bIsRejected=true&". BASE."objectManager.php?sClass=testData_queue&bIsQueue=true".
"sTitle=Rejected%20Test%20Results"); "&bIsRejected=true&sTitle=Rejected%20Test%20Results");
$g->addmisc(" "); $g->addmisc(" ");

View File

@@ -47,6 +47,14 @@ function global_sidebar_login() {
$g->add("Review Rejected Apps ($iAppsRejected)", BASE."appsubmit.php", "center"); $g->add("Review Rejected Apps ($iAppsRejected)", BASE."appsubmit.php", "center");
} }
/* Display the user's rejected test results */
$iTestDataRejected = testData::objectGetEntriesCount(true, true);
if($iTestDataRejected && !$_SESSION['current']->hasPriv("admin"))
$g->add("Review Rejected Test Results ($iTestDataRejected)",
BASE."objectManager.php?sClass=testData_queue&".
"sAction=view&bIsQueue=true&bIsRejected=true&sTitle=".
"Rejected+Test+Results", "center");
$aMonitored = Monitor::getVersionsMonitored($_SESSION['current']); $aMonitored = Monitor::getVersionsMonitored($_SESSION['current']);
if($aMonitored) if($aMonitored)
{ {

View File

@@ -15,7 +15,7 @@ function global_maintainer_admin_menu() {
BASE."objectManager.php?sClass=screenshot&bIsQueue=true&sTitle=". BASE."objectManager.php?sClass=screenshot&bIsQueue=true&sTitle=".
"Screenshot%20Queue"); "Screenshot%20Queue");
$g->add("View Test Results Queue (".testData::objectGetEntriesCount(true, false).")", $g->add("View Test Results Queue (".testData::objectGetEntriesCount(true, false).")",
BASE."objectManager.php?sClass=testData&bIsQueue=true&sTitle=". BASE."objectManager.php?sClass=testData_queue&bIsQueue=true&sTitle=".
"Test%20Results%20Queue"); "Test%20Results%20Queue");
$g->done(); $g->done();
} }

View File

@@ -68,12 +68,16 @@ class testData{
"installs, runs, testedRating, comments, submitterId, queued)". "installs, runs, testedRating, comments, submitterId, queued)".
" VALUES('?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',". " VALUES('?', '?', '?', '?', '?', '?', '?', '?', '?', '?', '?',".
"'?', '?')", "'?', '?')",
$this->iVersionId, $this->shWhatWorks, $this->shWhatDoesnt, $this->iVersionId, $this->shWhatWorks,
$this->shWhatNotTested, $this->sTestedDate, $this->iDistributionId, $this->shWhatDoesnt,
$this->sTestedRelease, $this->sInstalls, $this->sRuns, $this->shWhatNotTested, $this->sTestedDate,
$this->iDistributionId,
$this->sTestedRelease, $this->sInstalls,
$this->sRuns,
$this->sTestedRating, $this->sComments, $this->sTestedRating, $this->sComments,
$_SESSION['current']->iUserId, $_SESSION['current']->iUserId,
$this->mustBeQueued() ? "false" : "true"); $this->mustBeQueued() ? "true" : "false");
if($hResult) if($hResult)
{ {
$this->iTestingId = mysql_insert_id(); $this->iTestingId = mysql_insert_id();
@@ -469,14 +473,16 @@ class testData{
} }
/* retrieve the latest test result for a given version id */ /* retrieve the latest test result for a given version id */
function getNewestTestIdFromVersionId($iVersionId, $bQueued = false) function getNewestTestIdFromVersionId($iVersionId, $sQueued = "false")
{ {
$sQuery = "SELECT testingId FROM testResults WHERE $sQuery = "SELECT testingId FROM testResults WHERE
versionId = '?' versionId = '?'
AND AND
queued = '?' queued = '?'
ORDER BY testedDate DESC limit 1"; ORDER BY testedDate DESC limit 1";
$hResult = query_parameters($sQuery, $iVersionId, $bQueued ? "true" : "false");
$hResult = query_parameters($sQuery, $iVersionId, $sQueued);
if(!$hResult) if(!$hResult)
return 0; return 0;
@@ -717,9 +723,17 @@ class testData{
appMaintainers.userId = '?' appMaintainers.userId = '?'
AND AND
( (
appMaintainers.appId = appVersion.appid (
OR appMaintainers.superMaintainer = '1'
appMaintainers.versionId = appVersion.versionId AND
appMaintainers.appId = appVersion.appid
)
OR
(
appMaintainers.superMaintainer = '0'
AND
appMaintainers.versionId = appVersion.versionId
)
) )
AND AND
testResults.queued = '?'"; testResults.queued = '?'";
@@ -775,9 +789,17 @@ class testData{
appVersion.queued = 'false' appVersion.queued = 'false'
AND AND
( (
appMaintainers.appId = appVersion.appid (
OR appMaintainers.superMaintainer = '1'
appMaintainers.versionId = appVersion.versionId AND
appMaintainers.appId = appVersion.appid
)
OR
(
appMaintainers.superMaintainer = '0'
AND
appMaintainers.versionId = appVersion.versionId
)
) )
AND AND
testResults.queued = '?'"; testResults.queued = '?'";
@@ -832,8 +854,10 @@ class testData{
$this->sTestedRating); $this->sTestedRating);
if($this->canEdit() or $this->sQueued == "rejected") if($this->canEdit() or $this->sQueued == "rejected")
{
$aCells[] = "[ <a href=\"".$oObject->makeUrl("edit", $aCells[] = "[ <a href=\"".$oObject->makeUrl("edit",
$this->iTestingId)."\">$sEditLinkLabel</a> ]"; $this->iTestingId)."\">$sEditLinkLabel</a> ]";
}
echo html_tr($aCells, $this->sTestedRating); echo html_tr($aCells, $this->sTestedRating);
} }
@@ -844,6 +868,10 @@ class testData{
return TRUE; return TRUE;
else if($this->iVersionId) else if($this->iVersionId)
{ {
if($this->iSubmitterId == $_SESSION['current']->iUserId &&
$this->sQueued == "rejected")
return TRUE;
$oVersion = new version($this->iVersionId); $oVersion = new version($this->iVersionId);
if($_SESSION['current']->hasAppVersionModifyPermission($oVersion)) if($_SESSION['current']->hasAppVersionModifyPermission($oVersion))
return TRUE; return TRUE;
@@ -894,16 +922,16 @@ class testData{
function mustBeQueued() function mustBeQueued()
{ {
if($_SESSION['current']->hasPriv("admin")) if($_SESSION['current']->hasPriv("admin"))
return TRUE; return FALSE;
else if($this->iVersionId) else if($this->iVersionId)
{ {
$oVersion = new version($this->iVersionId); $oVersion = new version($this->iVersionId);
if($oVersion->canEdit()) if($oVersion->canEdit())
return TRUE;
else
return FALSE; return FALSE;
else
return TRUE;
} else } else
return FALSE; return TRUE;
} }
} }

View File

@@ -18,6 +18,7 @@ class testData_queue
$this->oDistribution->create(); $this->oDistribution->create();
$this->oTestData->iDistributionId = $this->oDistribution->iDistributionId; $this->oTestData->iDistributionId = $this->oDistribution->iDistributionId;
} }
return $this->oTestData->create(); return $this->oTestData->create();
} }
@@ -26,12 +27,24 @@ class testData_queue
return $this->oTestData->delete(); return $this->oTestData->delete();
} }
function reQueue()
{
$this->oTestData->reQueue();
if($this->oDistribution->sQueued == "rejected")
$this->oDistribution->reQueue();
}
function unQueue() function unQueue()
{ {
$this->oTestData->unQueue(); $this->oTestData->unQueue();
$this->oDistribution->unQueue(); $this->oDistribution->unQueue();
} }
function reject()
{
$this->oTestData->reject();
}
function update() function update()
{ {
$this->oTestData->update(); $this->oTestData->update();
@@ -42,17 +55,20 @@ class testData_queue
{ {
$this->oTestData->outputEditor(); $this->oTestData->outputEditor();
/* If we are processing queued test results with a queued distribution, we display /* If we are processing queued test results with a queued distribution,
some additional help here */ we display some additional help here */
if($this->oDistribution->sQueued != "false" && $this->canEdit()) if($this->oDistribution->sQueued != "false" && $this->canEdit())
{ {
echo "The user submitted a new distribution, which will be un-queued together ". echo "The user submitted a new distribution, which will be un-queued ".
"with the test data unless you select an existing one from the list above."; "together with the test data unless you select an existing one ".
"from the list above.";
} }
/* If the testData is already associated with a distribution and the distribution is /* If the testData is already associated with a distribution and the
un-queued, there is no need to display the distribution form here */ distribution is un-queued, there is no need to display the
if(!$this->oTestData->iDistributionId or $this->oDistribution->sQueued != "false") distribution form here */
if(!$this->oTestData->iDistributionId or
$this->oDistribution->sQueued != "false")
$this->oDistribution->outputEditor(); $this->oDistribution->outputEditor();
} }

View File

@@ -12,12 +12,8 @@ class version_queue
if($iVersionId) if($iVersionId)
{ {
if($this->oVersion->sQueued == "true")
$bQueued = TRUE;
if($this->oVersion->sQueued == "false")
$bQueued = FALSE;
$iTestingId = testData::getNewestTestIdFromVersionId($iVersionId, $iTestingId = testData::getNewestTestIdFromVersionId($iVersionId,
$bQueued); $this->oVersion->sQueued);
} }
$this->oTestDataQueue = new testData_queue($iTestingId); $this->oTestDataQueue = new testData_queue($iTestingId);
@@ -39,6 +35,12 @@ class version_queue
return TRUE; return TRUE;
} }
function reQueue()
{
$this->oVersion->reQueue();
$this->oTestDataQueue->reQueue();
}
function reject() function reject()
{ {
$this->oVersion->reject(); $this->oVersion->reject();