Let objectManager show testResults queue. Maintainers now get a list of queued test results

for versions they maintain.
This commit is contained in:
Alexander Nicolaysen Sørnes
2007-03-18 22:15:06 +00:00
committed by WineHQ
parent eb019fb611
commit 7f397c1dc4
4 changed files with 176 additions and 64 deletions

View File

@@ -143,28 +143,6 @@ else // if ($aClean['sSub']) is not defined, display the Test results queue page
$oTest = new TestData();
apidb_header("Test Results");
// Get queued test results.
$hResult = $oTest->getTestingQueue("true");
if(!$hResult)
{
//no apps in queue
echo html_frame_start("Submitted Test Results","90%");
echo '<p><b>The Submitted Test Results Queue is empty.</b></p>',"\n";
echo html_frame_end("&nbsp;");
}
else
{
//help
echo "<div align=center><table width='90%' border=0 cellpadding=3 cellspacing=0><tr><td>\n\n";
echo "<p>This is the list of test results waiting for submission, rejection or deletion.</p>\n";
echo "<p>To view a submission, click on its name. From that page you can Submit it into \n";
echo "the AppDB reject it or delete it.<br>\n";
echo "</td></tr></table></div>\n\n";
$oTest->ShowListofTests($hResult,"Submitted Test Results");
}
// Get rejected test results.
$hResult = $oTest->getTestingQueue("rejected");
if(!$hResult || !mysql_num_rows($hResult))

View File

@@ -30,13 +30,16 @@ function global_admin_menu() {
BASE."admin/adminMaintainers.php");
$g->add("View Bug Links (".getNumberOfQueuedBugLinks()."/".getNumberOfBugLinks().")",
BASE."admin/adminBugs.php");
$g->add("View Test Results Queue (".testData::getNumberOfQueuedTests().")",
BASE."admin/adminTestResults.php");
$g->add("View Test Results Queue (".testData::objectGetEntriesCount(true).")",
BASE."objectManager.php?sClass=testData&bIsQueue=true&sTitle=".
"Test%20Results%20Queue");
$g->add("View Distribution Queue (".distribution::objectGetEntriesCount(true).")",
BASE."objectManager.php?sClass=distribution&bIsQueue=true&sTitle=".
"Distribution%20Queue");
$g->addmisc("&nbsp;");
$g->add("View Rejected Test Results",
BASE."admin/adminTestResults.php");
$g->add("Users Management", BASE."admin/adminUsers.php");
$g->add("Comments Management", BASE."admin/adminCommentView.php");
$g->add("Screenshots Management", BASE."admin/adminScreenshots.php");

View File

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

View File

@@ -27,36 +27,35 @@ class testData{
function testData($iTestingId = null)
{
// we are working on an existing test
if(is_numeric($iTestingId))
if($iTestingId)
{
// We fetch the data related to this test.
if(!$this->iTestingId)
if(!$oRow)
{
$sQuery = "SELECT *
FROM testResults
WHERE testingId = '?'";
if($hResult = query_parameters($sQuery, $iTestingId))
{
$oRow = mysql_fetch_object($hResult);
if($oRow)
{
$this->iTestingId = $oRow->testingId;
$this->iVersionId = $oRow->versionId;
$this->shWhatWorks = $oRow->whatWorks;
$this->shWhatDoesnt = $oRow->whatDoesnt;
$this->shWhatNotTested = $oRow->whatNotTested;
$this->sTestedDate = $oRow->testedDate;
$this->iDistributionId = $oRow->distributionId;
$this->sTestedRelease = $oRow->testedRelease;
$this->sInstalls = $oRow->installs;
$this->sRuns = $oRow->runs;
$this->sTestedRating = $oRow->testedRating;
$this->sComments = $oRow->comments;
$this->sSubmitTime = $oRow->submitTime;
$this->iSubmitterId = $oRow->submitterId;
$this->sQueued = $oRow->queued;
}
}
}
if($oRow)
{
$this->iTestingId = $oRow->testingId;
$this->iVersionId = $oRow->versionId;
$this->shWhatWorks = $oRow->whatWorks;
$this->shWhatDoesnt = $oRow->whatDoesnt;
$this->shWhatNotTested = $oRow->whatNotTested;
$this->sTestedDate = $oRow->testedDate;
$this->iDistributionId = $oRow->distributionId;
$this->sTestedRelease = $oRow->testedRelease;
$this->sInstalls = $oRow->installs;
$this->sRuns = $oRow->runs;
$this->sTestedRating = $oRow->testedRating;
$this->sComments = $oRow->comments;
$this->sSubmitTime = $oRow->submitTime;
$this->iSubmitterId = $oRow->submitterId;
$this->sQueued = $oRow->queued;
}
}
}
@@ -687,24 +686,6 @@ class testData{
echo html_frame_end();
}
/* Get the number of TestResults in the database */
function getNumberOfQueuedTests()
{
$sQuery = "SELECT count(*) as num_tests
FROM testResults, appVersion
WHERE appVersion.versionId=testResults.versionId
and appVersion.queued='false'
and testResults.queued='true';";
$hResult = query_parameters($sQuery);
if($hResult)
{
$oRow = mysql_fetch_object($hResult);
return $oRow->num_tests;
}
return 0;
}
function make_Installs_list($sVarname, $sSelectedValue)
{
echo "<select name='$sVarname'>\n";
@@ -767,6 +748,153 @@ class testData{
return $sReturn;
}
function objectGetEntriesCount($bQueued)
{
if($bQueued && !testData::canEdit())
{
if(testData::canEditSome())
{
$sQuery = "SELECT COUNT(testingId) AS count FROM
testResults, appVersion, appMaintainers WHERE
testResults.versionId = appVersion.versionId
AND
appVersion.queued = 'false'
AND
appMaintainers.userId = '?'
AND
(
appMaintainers.appId = appVersion.appid
OR
appMaintainers.versionId = appVersion.versionId
)
AND
testResults.queued = '?'";
$hResult = query_parameters($sQuery, $_SESSION['current']->iUserId,
$bQueued ? "true": "false");
}
} else
{
$sQuery = "SELECT COUNT(testingId) as count FROM testResults,
appVersion WHERE
appVersion.versionId = testResults.versionId
AND
appVersion.queued = 'false'
AND
testResults.queued = '?'";
$hResult = query_parameters($sQuery, $bQueued ? "true" : "false");
}
if(!$hResult)
return FALSE;
if(!$oRow = mysql_fetch_object($hResult))
return FALSE;
return $oRow->count;
}
function objectGetEntries($bQueued)
{
if($bQueued && !testData::canEdit())
{
if(testData::canEditSome())
{
$sQuery = "SELECT testResults.* FROM testResults, appVersion,
appMaintainers WHERE
testResults.versionId = appVersion.versionId
AND
appMaintainers.userId = '?'
AND
appVersion.queued = 'false'
AND
(
appMaintainers.appId = appVersion.appid
OR
appMaintainers.versionId = appVersion.versionId
)
AND
testResults.queued = '?'";
$hResult = query_parameters($sQuery, $_SESSION['current']->iUserId,
$bQueued ? "true": "false");
}
} else
{
$sQuery = "SELECT testResults.* FROM testResults, appVersion WHERE
testResults.versionId = appVersion.versionId
AND
appVersion.queued = 'false'
AND
testResults.queued = '?' ORDER by testingId";
$hResult = query_parameters($sQuery, $bQueued ? "true" : "false");
}
if(!$hResult)
return FALSE;
return $hResult;
}
function objectGetHeader()
{
$aCells = array(
"Submission Date",
"Submitter",
"Application",
"Version",
"Release",
"Rating");
return $aCells;
}
function objectGetInstanceFromRow($oRow)
{
return new testData($oRow->testingId, $oRow);
}
function objectOutputTableRow($oObject, $sClass, $sEditLinkLabel)
{
$oVersion = new version($this->iVersionId);
$oApp = new application($oVersion->iAppId);
$oUser = new user($this->iSubmitterId);
$aCells = array(
print_date(mysqltimestamp_to_unixtimestamp($this->sSubmitTime)),
$oUser->sRealname,
$oApp->objectMakeLink(),
$oVersion->objectMakeLink(),
$this->sTestedRelease,
$this->sTestedRating);
if(testData::canEditSome())
$aCells[] = "[ <a href=\"".BASE."admin/adminTestResults.php?sSub=view&".
"iTestingId=$this->iTestingId\">$sEditLinkLabel</a> ]";
echo html_tr($aCells, $this->sTestedRating);
}
function canEditSome()
{
if(testData::canEdit() || maintainer::isUserMaintainer($_SESSION['current']))
return TRUE;
else
return FALSE;
}
function canEdit()
{
if($_SESSION['current']->hasPriv("admin"))
return TRUE;
else
return FALSE;
}
function objectDisplayQueueProcessingHelp()
{
echo "<p>This is the list of test results waiting for submission, ".
"rejection or deletion.</p>\n";
echo "<p>To view a submission, click on its name. From that page ".
"you can submit it into the AppDB, reject it or delete it.</p>\n";
}
}
?>