logo       
Google Custom Search
    AddThis Social Bookmark Button

cvs: pearweb /public_html/bugs stats.php: msg#00120

Subject: cvs: pearweb /public_html/bugs stats.php
dufuz           Sun Apr 22 04:03:46 2007 UTC

  Modified files:              
    /pearweb/public_html/bugs   stats.php 
  Log:
  Request #10766 highlight own name on bug stats page
  
http://cvs.php.net/viewvc.cgi/pearweb/public_html/bugs/stats.php?r1=1.51&r2=1.52&diff_format=u
Index: pearweb/public_html/bugs/stats.php
diff -u pearweb/public_html/bugs/stats.php:1.51 
pearweb/public_html/bugs/stats.php:1.52
--- pearweb/public_html/bugs/stats.php:1.51     Sun Apr 22 01:51:36 2007
+++ pearweb/public_html/bugs/stats.php  Sun Apr 22 04:03:46 2007
@@ -15,7 +15,7 @@
  * @package   Bugs
  * @copyright Copyright (c) 1997-2005 The PHP Group
  * @license   http://www.php.net/license/3_0.txt  PHP License
- * @version   $Id: stats.php,v 1.51 2007/04/22 01:51:36 dufuz Exp $
+ * @version   $Id: stats.php,v 1.52 2007/04/22 04:03:46 dufuz Exp $
  */
 
 /**
@@ -62,6 +62,16 @@
     $sort_by = 'Open';
 }
 
+// Fetch all packages of the user if someone is logged in
+if ($auth_user) {
+    include_once 'pear-database-user.php';
+    $pck = user::getPackages($auth_user->handle);
+    $packages = array();
+    foreach ($pck as $p) {
+        $packages[] = $p['name'];
+    }
+}
+
 $query  = 'SELECT b.package_name, b.status, COUNT(*) AS quant'
         . ' FROM bugdb AS b';
 
@@ -256,19 +266,26 @@
 
 $stat_row = 1;
 foreach ($pkg[$sort_by] as $name => $value) {
+    // Check if the logged in user maintains this package
+    if (in_array($name, $packages)) {
+        $class = ' bug_bg_selected';
+    } else {
+        $class = '';
+    }
+
     if ($name != 'all') {
         /* Output a new header row every 40 lines */
         if (($stat_row++ % 40) == 0) {
             echo display_stat_header($total, false);
         }
         echo " <tr>\n";
-        echo '  <td class="bug_head">' . package_link($name) . "</td>\n";
-        echo '  <td class="bug_bg0">' . $pkg_total[$name];
+        echo '  <td class="bug_head'.$class.'">' . package_link($name) . 
"</td>\n";
+        echo '  <td class="bug_bg0'.$class.'">' . $pkg_total[$name];
         echo "</td>\n";
 
         $i = 1;
         foreach ($titles as $key => $val) {
-            echo '  <td class="bug_bg' . $i++ % 2 . '">';
+            echo '  <td class="bug_bg' . $i++ % 2 . ''.$class.'">';
             echo bugstats($key, $name) . "</td>\n";
         }
         echo ' </tr>' . "\n";
@@ -294,10 +311,13 @@
   <th class="bug_head">Developer</th>
  </tr>
 <?php
+$handle = isset($auth_user->handle) ? $auth_user->handle : '';
+
 foreach ($develstats as $stat) {
+    $style = $stat['handle'] == $handle ? ' style="background-color: yellow;"' 
: '';
     echo " <tr>\n";
-    echo '  <td class="bug_bg0">' . $stat['c'] . "</td>\n";
-    echo '  <td class="bug_bg0"><a href="/user/' . $stat['handle'] . '">' .
+    echo '  <td class="bug_bg0"'.$style.'>' . $stat['c'] . "</td>\n";
+    echo '  <td class="bug_bg0"'.$style.'><a href="/user/' . $stat['handle'] . 
'">' .
         $stat['handle'] . "</a></td>\n";
     echo " </tr>\n";
 }
@@ -311,9 +331,10 @@
  </tr>
 <?php
 foreach ($lastmonth as $stat) {
+    $style = $stat['handle'] == $handle ? ' style="background-color: yellow;"' 
: '';
     echo " <tr>\n";
-    echo '  <td class="bug_bg0">' . $stat['c'] . "</td>\n";
-    echo '  <td class="bug_bg0"><a href="/user/' . $stat['handle'] . '">' .
+    echo '  <td class="bug_bg0"'.$style.'>' . $stat['c'] . "</td>\n";
+    echo '  <td class="bug_bg0"'.$style.'><a href="/user/' . $stat['handle'] . 
'">' .
         $stat['handle'] . "</a></td>\n";
     echo " </tr>\n";
 }
@@ -326,9 +347,10 @@
  </tr>
 <?php
 foreach ($reporters as $dev => $stat) {
+    $style = $dev == $handle ? ' style="background-color: yellow;"' : '';
     echo " <tr>\n";
-    echo '  <td class="bug_bg0">' . $stat . "</td>\n";
-    echo '  <td class="bug_bg0"><a href="/user/' . $dev . '">' .
+    echo '  <td class="bug_bg0"'.$style.'>' . $stat . "</td>\n";
+    echo '  <td class="bug_bg0"'.$style.'><a href="/user/' . $dev . '">' .
         $dev . "</a></td>\n";
     echo " </tr>\n";
 }




Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>