Allow the user to limit or show all of the testing results for a particular version

This commit is contained in:
Jason Weisberger
2006-01-28 22:53:28 +00:00
committed by WineHQ
parent 7714218746
commit b5d70fc27a
2 changed files with 45 additions and 10 deletions

View File

@@ -524,7 +524,10 @@ else if($_REQUEST['versionId'])
$oTest = new TestData($_REQUEST['iTestingId']); $oTest = new TestData($_REQUEST['iTestingId']);
$iCurrentTest = $oTest->ShowTestResult($oTest->iTestingId,$oVersion->iVersionId); $iCurrentTest = $oTest->ShowTestResult($oTest->iTestingId,$oVersion->iVersionId);
if($iCurrentTest) if($iCurrentTest)
$oTest->ShowVersionsTestingTable($oVersion->iVersionId,$iCurrentTest,$_SERVER['PHP_SELF']."?versionId=".$oVersion->iVersionId."&iTestingId="); $oTest->ShowVersionsTestingTable($oVersion->iVersionId,
$iCurrentTest,
$_SERVER['PHP_SELF']."?versionId=".$oVersion->iVersionId."&iTestingId=",
5);
echo '<form method=post name=message action=testResults.php?sub=view&iVersionId='.$oVersion->iVersionId.'>'; echo '<form method=post name=message action=testResults.php?sub=view&iVersionId='.$oVersion->iVersionId.'>';
echo '<input type=submit value="Add Testing Data" class="button" />'; echo '<input type=submit value="Add Testing Data" class="button" />';
echo '</form>'; echo '</form>';

View File

@@ -347,13 +347,25 @@ class testData{
} }
// Show the Test results for a application version // Show the Test results for a application version
function ShowVersionsTestingTable($iVersionId, $iCurrentTest, $link) function ShowVersionsTestingTable($iVersionId, $iCurrentTest, $link, $iDisplayLimit)
{ {
$hResult = query_appdb("SELECT * $showAll = $_REQUEST['showAll'];
FROM testResults
WHERE versionId = '".$iVersionId."' $sQuery = "SELECT *
ORDER BY testedDate DESC;"); FROM testResults
if(!$hResult || mysql_num_rows($hResult) == 0) WHERE versionId = '".$iVersionId."'
ORDER BY testedDate DESC";
if(!$showAll)
$sQuery.=" LIMIT 0,".$iDisplayLimit;
$hResult = query_appdb($sQuery);
if(!$hResult)
return;
$rowsUsed = mysql_num_rows($hResult);
if($rowsUsed == 0)
return; return;
echo '<p><span class="title">Testing Results</span><br />',"\n"; echo '<p><span class="title">Testing Results</span><br />',"\n";
echo '<table width="100%" border="1" class="historyTable">',"\n"; echo '<table width="100%" border="1" class="historyTable">',"\n";
@@ -376,10 +388,20 @@ class testData{
$oDistribution = new distribution($oTest->iDistributionId); $oDistribution = new distribution($oTest->iDistributionId);
$bgcolor = $oTest->sTestedRating; $bgcolor = $oTest->sTestedRating;
echo '<tr class='.$bgcolor.'>',"\n"; echo '<tr class='.$bgcolor.'>',"\n";
if ($oTest->iTestingId == $iCurrentTest) if ($oTest->iTestingId == $iCurrentTest)
{
echo ' <td align="center" class="color2"><b>Current</b></td>',"\n"; echo ' <td align="center" class="color2"><b>Current</b></td>',"\n";
else } else
echo ' <td align="center" class="color2">[<a href="'.$link.$oTest->iTestingId.'">Show</a>]</td>',"\n"; {
echo ' <td align="center" class="color2">[<a href="'.$link.$oTest->iTestingId;
if(is_string($showAll))
echo '&showAll='.$showAll.'">Show</a>]</td>',"\n";
else
echo '">Show</a>]</td>',"\n";
}
echo ' <td>',"\n"; echo ' <td>',"\n";
echo '<a href="'.BASE.'distributionView.php?iDistributionId='.$oTest->iDistributionId.'">',"\n"; echo '<a href="'.BASE.'distributionView.php?iDistributionId='.$oTest->iDistributionId.'">',"\n";
echo $oDistribution->sName.'</a>',"\n"; echo $oDistribution->sName.'</a>',"\n";
@@ -394,8 +416,18 @@ class testData{
echo '</table>',"\n"; echo '</table>',"\n";
echo '<form method=get action="'.$PHP_SELF.'">';
echo '<input name="versionId" type=hidden value="',$iVersionId,'" />';
if($rowsUsed >= $iDisplayLimit && !is_string($showAll))
echo '<input class="button" name="showAll" type=submit value="Show All Tests" />';
if(is_string($showAll))
{
echo '<input class="button" name="hideAll" type=submit value="Limit to '.$iDisplayLimit.' Tests" />';
}
echo '</form>';
} }
// show the fields for editing // show the fields for editing
function OutputEditor($sDistribution, $bNewDist=false) function OutputEditor($sDistribution, $bNewDist=false)
{ {