From b5d70fc27aa51d9e52cf5f65abfc869009d276c9 Mon Sep 17 00:00:00 2001 From: Jason Weisberger Date: Sat, 28 Jan 2006 22:53:28 +0000 Subject: [PATCH] Allow the user to limit or show all of the testing results for a particular version --- appview.php | 5 ++++- include/testResults.php | 50 +++++++++++++++++++++++++++++++++-------- 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/appview.php b/appview.php index 132d647..096f58d 100644 --- a/appview.php +++ b/appview.php @@ -524,7 +524,10 @@ else if($_REQUEST['versionId']) $oTest = new TestData($_REQUEST['iTestingId']); $iCurrentTest = $oTest->ShowTestResult($oTest->iTestingId,$oVersion->iVersionId); 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 '
iVersionId.'>'; echo ''; echo '
'; diff --git a/include/testResults.php b/include/testResults.php index 4221d3a..fb9f696 100644 --- a/include/testResults.php +++ b/include/testResults.php @@ -347,13 +347,25 @@ class testData{ } // Show the Test results for a application version - function ShowVersionsTestingTable($iVersionId, $iCurrentTest, $link) + function ShowVersionsTestingTable($iVersionId, $iCurrentTest, $link, $iDisplayLimit) { - $hResult = query_appdb("SELECT * - FROM testResults - WHERE versionId = '".$iVersionId."' - ORDER BY testedDate DESC;"); - if(!$hResult || mysql_num_rows($hResult) == 0) + $showAll = $_REQUEST['showAll']; + + $sQuery = "SELECT * + FROM testResults + 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; echo '

Testing Results
',"\n"; echo '',"\n"; @@ -376,10 +388,20 @@ class testData{ $oDistribution = new distribution($oTest->iDistributionId); $bgcolor = $oTest->sTestedRating; echo '',"\n"; + if ($oTest->iTestingId == $iCurrentTest) + { echo ' ',"\n"; - else - echo ' ',"\n"; + } else + { + echo ' ',"\n"; + else + echo '">Show]',"\n"; + } + echo '
Current[Show][Show]',"\n"; echo '',"\n"; echo $oDistribution->sName.'',"\n"; @@ -393,9 +415,19 @@ class testData{ } echo '
',"\n"; - + echo '

'; + echo ''; + if($rowsUsed >= $iDisplayLimit && !is_string($showAll)) + echo ''; + + if(is_string($showAll)) + { + echo ''; + } + echo '
'; } + // show the fields for editing function OutputEditor($sDistribution, $bNewDist=false) {