[AppDB] Don't display queued Versions (better solution)

Tony Lambregts tony.lambregts at gmail.com
Sun Oct 30 09:54:40 CST 2005


Change Log: Do not display queued Versions make the name clearer too.

Files Changed: appsubmit.php appview.php admin/adminAppQueue.php 
include/version.php include/util.php
-------------- next part --------------
Index: appview.php
===================================================================
RCS file: /home/wine/appdb/appview.php,v
retrieving revision 1.75
diff -u -r1.75 appview.php
--- appview.php	28 Oct 2005 00:11:35 -0000	1.75
+++ appview.php	30 Oct 2005 15:50:18 -0000
@@ -313,7 +313,7 @@
     echo html_frame_end("For more details and user comments, view the versions of this application.");
 
     // display versions
-    display_versions($oApp->iAppId,$oApp->aVersionsIds);
+    display_approved_versions($oApp->aVersionsIds);
 
     // display bundle
     display_bundle($oApp->iAppId);
Index: admin/adminAppQueue.php
===================================================================
RCS file: /home/wine/appdb/admin/adminAppQueue.php,v
retrieving revision 1.47
diff -u -r1.47 adminAppQueue.php
--- admin/adminAppQueue.php	28 Oct 2005 00:11:35 -0000	1.47
+++ admin/adminAppQueue.php	30 Oct 2005 15:50:19 -0000
@@ -269,7 +269,7 @@
         { 
             echo html_frame_start("Potential duplicate versions in the database","90%","",0);
             $oAppForVersion = new Application($oVersion->iAppId);
-            display_versions($oAppForVersion->iAppId, $oAppForVersion->aVersionsIds);
+            display_approved_versions($oAppForVersion->aVersionsIds);
             echo html_frame_end(" ");
 
             //help
Index: include/version.php
===================================================================
RCS file: /home/wine/appdb/include/version.php,v
retrieving revision 1.42
diff -u -r1.42 version.php
--- include/version.php	29 Oct 2005 04:41:10 -0000	1.42
+++ include/version.php	30 Oct 2005 15:50:20 -0000
@@ -664,4 +664,47 @@
 
 }
 
+// display the versions
+// Used in appview.php appsubmit.php and adminAppQueue.php
+function display_approved_versions($aVersionsIds)
+{
+    if ($aVersionsIds)
+    {
+        echo html_frame_start("","98%","",0);
+        echo "<table width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\">\n\n";
+
+        echo "<tr class=color4>\n";
+        echo "    <td width=\"80\">Version</td>\n";
+        echo "    <td>Description</td>\n";
+        echo "    <td width=\"80\">Rating</td>\n";
+        echo "    <td width=\"80\">Wine version</td>\n";
+        echo "    <td width=\"40\">Comments</td>\n";
+        echo "</tr>\n\n";
+      
+        $c = 0;
+        foreach($aVersionsIds as $iVersionId)
+        {
+            $oVersion = new Version($iVersionId);
+            if ($oVersion->sQueued = 'false')
+            {
+                // set row color
+                $bgcolor = ($c % 2 == 0) ? "color0" : "color1";
+
+                //display row
+                echo "<tr class=$bgcolor>\n";
+                echo "    <td><a href=\"".BASE."appview.php?versionId=".$iVersionId."\">".$oVersion->sName."</a></td>\n";
+                echo "    <td>".trim_description($oVersion->sDescription)."</td>\n";
+                echo "    <td align=center>".$oVersion->sTestedRating."</td>\n";
+                echo "    <td align=center>".$oVersion->sTestedRelease."</td>\n";
+                echo "    <td align=center>".sizeof($oVersion->aCommentsIds)."</td>\n";
+                echo "</tr>\n\n";
+
+                $c++;   
+            }
+        }
+        echo "</table>\n";
+        echo html_frame_end("Click the Version Name to view the details of that Version");
+    }
+}
+
 ?>
Index: include/util.php
===================================================================
RCS file: /home/wine/appdb/include/util.php,v
retrieving revision 1.49
diff -u -r1.49 util.php
--- include/util.php	17 Oct 2005 03:59:24 -0000	1.49
+++ include/util.php	30 Oct 2005 15:50:21 -0000
@@ -535,50 +535,6 @@
     }
 }
 
-/**
- * display the versions
- * Used in appview.php and adminAppQueue.php
- */
-function display_versions($iAppId, $aVersionsIds)
-{
-    if ($aVersionsIds)
-    {
-        echo html_frame_start("","98%","",0);
-        echo "<table width=\"100%\" border=\"0\" cellpadding=\"3\" cellspacing=\"1\">\n\n";
-
-        echo "<tr class=color4>\n";
-        echo "    <td width=\"80\">Version</td>\n";
-        echo "    <td>Description</td>\n";
-        echo "    <td width=\"80\">Rating</td>\n";
-        echo "    <td width=\"80\">Wine version</td>\n";
-        echo "    <td width=\"40\">Comments</td>\n";
-        echo "</tr>\n\n";
-      
-        $c = 0;
-        foreach($aVersionsIds as $iVersionId)
-        {
-            $oVersion = new Version($iVersionId);
-
-            // set row color
-            $bgcolor = ($c % 2 == 0) ? "color0" : "color1";
-
-            //display row
-            echo "<tr class=$bgcolor>\n";
-            echo "    <td><a href=\"".BASE."appview.php?versionId=".$iVersionId."\">".$oVersion->sName."</a></td>\n";
-            echo "    <td>".trim_description($oVersion->sDescription)."</td>\n";
-            echo "    <td align=center>".$oVersion->sTestedRating."</td>\n";
-            echo "    <td align=center>".$oVersion->sTestedRelease."</td>\n";
-            echo "    <td align=center>".sizeof($oVersion->aCommentsIds)."</td>\n";
-            echo "</tr>\n\n";
-
-            $c++;   
-
-        }
-        echo "</table>\n";
-        echo html_frame_end("Click the Version Name to view the details of that Version");
-    }
-}
-
 /* pass in $isVersion of true if we are processing changes for an app version */
 /* or false if processing changes for an application family */
 function process_app_version_changes($isVersion)


More information about the wine-patches mailing list