Patch to limit testing results in AppDB
Jason Weisberger
jbdubbs at gmail.com
Wed Jan 25 19:40:43 CST 2006
Name: Patch to limit testing results in AppDB
Changelog: include/testingResults.php
included code to initially show 5 results, then show the rest if the user
wishes.
Index: appdb/include/testResults.php
===================================================================
RCS file: /home/wine/appdb/include/testResults.php,v
retrieving revision 1.8
diff -u -r1.8 testResults.php
--- appdb/include/testResults.php 23 Jan 2006 02:10:32 -0000 1.8
+++ appdb/include/testResults.php 26 Jan 2006 01:32:59 -0000
@@ -324,6 +324,7 @@
function ShowTestResult($iCurrentTest,$iVersionId)
{
+
$hResult = query_appdb("SELECT *
FROM testResults
WHERE testingId = '".$iCurrentTest."';");
@@ -349,10 +350,24 @@
// Show the Test results for a application version
function ShowVersionsTestingTable($iVersionId, $iCurrentTest, $link)
{
- $hResult = query_appdb("SELECT *
+ global $showAll;
+
+ $hResult = query_appdb("SELECT *
+ FROM testResults
+ WHERE versionId = '".$iVersionId."'
+ ORDER BY testedDate DESC;");
+ if(mysql_num_rows($hResult) <= 5 || is_string($showAll)) {
+ $hResult = query_appdb("SELECT *
FROM testResults
WHERE versionId = '".$iVersionId."'
ORDER BY testedDate DESC;");
+ }
+ else{
+ $hResult = query_appdb("SELECT *
+ FROM testResults
+ WHERE versionId = '".$iVersionId."'
+ ORDER BY testedDate DESC LIMIT 0,5;");
+ }
if(!$hResult || mysql_num_rows($hResult) == 0)
return;
echo '<p><span class="title">Testing Results</span><br />',"\n";
@@ -379,7 +394,9 @@
if ($oTest->iTestingId == $iCurrentTest)
echo ' <td align="center"
class="color2"><b>Current</b></td>',"\n";
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 '<a href="'.BASE.'distributionView.php
?iDistributionId='.$oTest->iDistributionId.'">',"\n";
echo $oDistribution->sName.'</a>',"\n";
@@ -393,6 +410,20 @@
}
echo '</table>',"\n";
+
+ if(mysql_num_rows($hResult) >= 5 AND !is_string($showAll)) {
+ echo '<form method=get action="'.$PHP_SELF.'">';
+ echo '<input name="versionId" type=hidden value="',$iVersionId,'"
/>';
+ echo '<input class="button" name="showAll" type=submit value="Show
All Tests" />';
+ echo '</form>';
+ }
+ if(is_string($showAll)) {
+ echo '<form method=get action="'.$PHP_SELF.'">';
+ echo '<input name="versionId" type=hidden value="',$iVersionId,'"
/>';
+ echo '<input class="button" name="hideAll" type=submit value="Limit
to 5 Tests" />';
+ echo '</form>';
+ unset($showAll);
+ }
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winehq.org/pipermail/wine-patches/attachments/20060126/f94408cf/attachment-0001.htm
More information about the wine-patches
mailing list