appdb/include bugs.php

WineHQ wineowner at wine.codeweavers.com
Sat Jul 21 18:32:10 CDT 2007


ChangeSet ID:	31256
CVSROOT:	/opt/cvs-commit
Module name:	appdb
Changes by:	wineowner at winehq.org	2007/07/21 18:32:10

Modified files:
	include        : bugs.php 

Log message:
	Edwin Smulders <edwin.smulders at gmail.com>
	Hide resolved bugs by default, add link to toggle between hiding resolved bugs and showing all
	bugs.

Patch: http://cvs.winehq.org/patch.py?id=31256

Old revision  New revision  Changes     Path
 1.25          1.26          +46 -25     appdb/include/bugs.php

Index: appdb/include/bugs.php
diff -u -p appdb/include/bugs.php:1.25 appdb/include/bugs.php:1.26
--- appdb/include/bugs.php:1.25	21 Jul 2007 23:32:10 -0000
+++ appdb/include/bugs.php	21 Jul 2007 23:32:10 -0000
@@ -335,44 +335,65 @@ function view_version_bugs($iVersionId =
     {
         $oBuglink = new Bug($iBuglinkId);
 
-        // set row color
-        $bgcolor = ($c % 2 == 0) ? "color0" : "color1";
-
-        //display row
-        echo "<tr class=$bgcolor>\n";
-        echo "<td align=center><a href='".BUGZILLA_ROOT."show_bug.cgi?id=".$oBuglink->iBug_id."'>".$oBuglink->iBug_id."</a></td>\n";
-        echo "<td>".$oBuglink->sShort_desc."</td>\n";
-        echo "<td align=center>".$oBuglink->sBug_status."</td>","\n";
-        echo "<td align=center>".$oBuglink->sResolution."</td>","\n";
-        echo "<td align=center><a href='viewbugs.php?bug_id=".$oBuglink->iBug_id."'>View</a></td>\n";
- 
-        
-        if($bCanEdit == true)
+        if ( (!isset($aClean['sAllBugs']) && $oBuglink->sBug_status != 'RESOLVED')
+             || isset($aClean['sAllBugs']) )
         {
-            echo "<td align=center>[<a href='".$oVersion->objectMakeUrl()."&sSub=delete&iBuglinkId=".$oBuglink->iLinkId."'>delete</a>]</td>\n";
-            if ($oBuglink->bQueued)
-            {
-                echo "<td align=center>[<a href='".$oVersion->objectMakeUrl()."&sSub=unqueue&iBuglinkId=".$oBuglink->iLinkId."'>OK</a>]</td>\n";
-            } else
+            // set row color
+            $bgcolor = ($c % 2 == 0) ? "color0" : "color1";
+
+            //display row
+            echo "<tr class=$bgcolor>\n";
+            echo "<td align=center><a href='".BUGZILLA_ROOT."show_bug.cgi?id=".$oBuglink->iBug_id."'>".$oBuglink->iBug_id."</a></td>\n";
+            echo "<td>".$oBuglink->sShort_desc."</td>\n";
+            echo "<td align=center>".$oBuglink->sBug_status."</td>","\n";
+            echo "<td align=center>".$oBuglink->sResolution."</td>","\n";
+            echo "<td align=center><a href='viewbugs.php?bug_id=".$oBuglink->iBug_id."'>View</a></td>\n";
+    
+            
+            if($bCanEdit == true)
             {
-                echo "<td align=center>Yes</td>\n";
+                echo "<td align=center>[<a href='".$oVersion->objectMakeUrl()."&sSub=delete&iBuglinkId=".$oBuglink->iLinkId."'>delete</a>]</td>\n";
+                if ($oBuglink->bQueued)
+                {
+                    echo "<td align=center>[<a href='".$oVersion->objectMakeUrl()."&sSub=unqueue&iBuglinkId=".$oBuglink->iLinkId."'>OK</a>]</td>\n";
+                } else
+                {
+                    echo "<td align=center>Yes</td>\n";
+                }
+                
             }
-               
-        }
-        echo "</tr>\n\n";
- 
+            echo "</tr>\n\n";
+    
 
-        $c++;   
+            $c++;
+        }
     }
+
     if($_SESSION['current']->isLoggedIn())
     {
         echo '<input type="hidden" name="iVersionId" value="'.$iVersionId.'">',"\n";
         echo '<tr class=color3><td align=center>',"\n";
-        echo '<input type="text" name="iBuglinkId" value="'.$aClean['buglinkId'].'" size="8"></td>',"\n";
+        $sBuglinkId = isset($aClean['buglinkId']) ? $aClean['buglinkId'] : '';
+        echo '<input type="text" name="iBuglinkId" value="'.$sBuglinkId.'" size="8"></td>',"\n";
         echo '<td><input type="submit" name="sSub" value="Submit a new bug link."></td>',"\n";
         echo '<td colspan=6></td></tr></form>',"\n";
     }
     echo '</table>',"\n";
+
+    // show only open link
+    if ( isset( $aClean['sAllBugs'] ) )
+    {
+        $sURL = str_replace( '&sAllBugs', '', $_SERVER['REQUEST_URI'] );
+        $sLink = '<a href="' . $sURL . '">Show Open Bugs</a>';
+    }
+    // show all link
+    else
+    {
+        $sURL = $_SERVER['REQUEST_URI'] . '&sAllBugs';
+        $sLink = '<a href="' . $sURL . '">Show All Bugs</a>';
+    }
+    
+    echo '<div style="text-align:right;">' . $sLink .'</div>';
     echo html_frame_end();
 }
 



More information about the wine-cvs mailing list