[AppDB] Lets not show test results when the version is still queued.

Tony Lambregts tony.lambregts at gmail.com
Mon Jan 16 00:07:05 CST 2006


Change log: Don't show test results when the version is still queued

Files changed: include/testResults.php
-------------- next part --------------
Index: include/testResults.php
===================================================================
RCS file: /home/wine/appdb/include/testResults.php,v
retrieving revision 1.6
diff -u -r1.6 testResults.php
--- include/testResults.php	12 Nov 2005 04:37:48 -0000	1.6
+++ include/testResults.php	16 Jan 2006 05:16:33 -0000
@@ -566,23 +566,29 @@
         {
             $oTest = new testData($oRow->testingId);
             $oVersion = new version($oTest->iVersionId);
-            $oApp  = new application($oVersion->iAppId);
-            $oSubmitter = new User($oTest->iSubmitterId);
-            if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
-            echo "<tr class=\"$bgcolor\">\n";
-            echo "    <td>".print_date(mysqltimestamp_to_unixtimestamp($oTest->sSubmitTime))."</td>\n";
-            echo "    <td>\n";
-            echo $oSubmitter->sEmail ? "<a href=\"mailto:".$oSubmitter->sEmail."\">":"";
-            echo $oSubmitter->sRealname;
-            echo $oSubmitter->sEmail ? "</a>":"";
-            echo "    </td>\n";
-            echo "    <td>".$oApp->sName."</td>\n";
-            echo "    <td>".$oVersion->sName."</td>\n";
-            echo "    <td>".$oTest->sTestedRelease."</td>\n";
-            echo "    <td align=\"center\">[<a href=".$_SERVER['PHP_SELF']."?sub=view&iTestingId=".$oTest->iTestingId.">process</a>]</td>\n";
-            echo "</tr>\n\n";
-            $c++;
+            // dont show testing results of versions that are still queued.
+            if ($oVersion->sQueued == 'false')
+            {
+                $oApp  = new application($oVersion->iAppId);
+                $oSubmitter = new User($oTest->iSubmitterId);
+                if ($c % 2 == 1) { $bgcolor = 'color0'; } else { $bgcolor = 'color1'; }
+                echo "<tr class=\"$bgcolor\">\n";
+                echo "    <td>".print_date(mysqltimestamp_to_unixtimestamp($oTest->sSubmitTime))."</td>\n";
+                echo "    <td>\n";
+                echo $oSubmitter->sEmail ? "<a href=\"mailto:".$oSubmitter->sEmail."\">":"";
+                echo $oSubmitter->sRealname;
+                echo $oSubmitter->sEmail ? "</a>":"";
+                echo "    </td>\n";
+                echo "    <td>".$oApp->sName."</td>\n";
+                echo "    <td>".$oVersion->sName."</td>\n";
+                echo "    <td>".$oTest->sTestedRelease."</td>\n";
+                echo "    <td align=\"center\">[<a href=".$_SERVER['PHP_SELF']."?sub=view&iTestingId=".$oTest->iTestingId.">process</a>]</td>\n";
+                echo "</tr>\n\n";
+                $c++;
+            }
         }
+        echo "</table>","\n";
+        
         echo html_frame_end();
 
     }
@@ -591,7 +597,13 @@
 /* Get the number of TestResults in the database */
 function getNumberOfQueuedTests()
 {
-    $hResult = query_appdb("SELECT count(*) as num_tests FROM testResults WHERE queued='true';");
+    $sQuery = "SELECT count(*) as num_tests
+               FROM testResults, appVersion
+               WHERE appVersion.versionId=testResults.versionId
+               and appVersion.queued='false' 
+               and testResults.queued='true';";
+
+    $hResult = query_appdb($sQuery);
     if($hResult)
     {
       $row = mysql_fetch_object($hResult);


More information about the wine-patches mailing list