List:Commits« Previous MessageNext Message »
From:Hakan Kuecuekyilmaz Date:June 30 2008 1:21pm
Subject:bzr commit into mysql-falcon branch (hakan:213)
View as plain text  
#At bzr+ssh://bk-internal.mysql.com/bzrroot/mysql-falcon/

  213 Hakan Kuecuekyilmaz	2008-06-30
      Added "Id | Priority | Status | Short description" of last seven days.
modified:
  falcon_bug_statistic/falcon_bug_statistic.php
  falcon_bug_statistic/falcon_bug_statistic_text.php
  falcon_bug_statistic/include/fbs_query.php

=== modified file 'falcon_bug_statistic/falcon_bug_statistic.php'
--- a/falcon_bug_statistic/falcon_bug_statistic.php	2008-06-30 10:30:36 +0000
+++ b/falcon_bug_statistic/falcon_bug_statistic.php	2008-06-30 13:21:56 +0000
@@ -138,6 +138,49 @@ require_once './include/fbs_query.php';
             </table></td>
         </tr>
     </table>
+
+    <br />
+    <br />
+
+    <table style="width: 90%;">
+        <tr>
+            <td colspan="4"><h2>Bugs reported in the last 7 days</h2></td>
+        </tr>
+        <tr>
+            <td><h2>Id</h2></td>
+            <td><h2>Priority</h2></td>
+            <td><h2>Status</h2></td>
+            <td><h2>Short description</h2></td>
+        </tr>
+        <?php
+        $i = 0;
+        $sum = 0;
+        while ($row = mysql_fetch_assoc($res_last_seven)) {
+            $i++;
+            $url = sprintf('http://bugs.mysql.com/%d', $row[id]);
+
+            if ($i % 2) {
+                echo '<tr class="even">' . "\n";
+            } else {
+                echo '<tr class="odd">' . "\n";
+            }
+            echo '    <td><a href="' . $url . '">' . $row['id'] . '</a></td>' . "\n";
+            echo '    <td>' . $row['priority'] . '</td>' . "\n";
+            echo '    <td>' . $row['status'] . '</td>' . "\n";
+            echo '    <td>' . $row['sdesc'] . '</td>' . "\n";
+            echo '</tr>' . "\n";
+        }
+
+        echo '<tr>' . "\n";
+        echo '    <td><b>All</b></td>' . "\n";
+        echo '    <td>&nbsp;</td>' . "\n";
+        echo '    <td>&nbsp;</td>' . "\n";
+        echo '    <td><b>' . $i . '</b></td>' . "\n";
+        echo '</tr>' . "\n";
+
+        ?>
+
+    </table>
 </div>
 
 </body>

=== modified file 'falcon_bug_statistic/falcon_bug_statistic_text.php'
--- a/falcon_bug_statistic/falcon_bug_statistic_text.php	2008-06-30 08:51:27 +0000
+++ b/falcon_bug_statistic/falcon_bug_statistic_text.php	2008-06-30 13:21:56 +0000
@@ -9,19 +9,34 @@
 require_once './include/config.inc.php';
 require_once './include/fbs_query.php';
 
+$line = 78;
+
 $ch = 7;
+$ih = 6;
 $ph = 9;
 $sh = 15;
 $cv = 3;
 
+$dh = $line - $ih - $ph - $sh;
+
 define('C_HEADER', '%-' . $ch . 's');
+define('I_HEADER', '%-' . $ih . 's');
 define('P_HEADER', '%-' . $ph . 's');
 define('S_HEADER', '%-' . $sh . 's');
+define('D_HEADER', '%-' . $dh . 's');
 define('C_VALUE', '%' . $cv . 'd');
 
-$hr_pc =  str_repeat('-', $ph) . '+' . str_repeat('-', $ch) . "\n";
-$hr_sc =  str_repeat('-', $sh) . '+' . str_repeat('-', $ch) . "\n";
-$hr_psc = str_repeat('-', $ph) . '+' . str_repeat('-', $sh + 1) . '+' . str_repeat('-', $ch) . "\n";
+/**
+ * Horizontal rules.
+ */
+$hr_pc =   str_repeat('-', $ph) . '+' . str_repeat('-', $ch) . "\n";
+$hr_sc =   str_repeat('-', $sh) . '+' . str_repeat('-', $ch) . "\n";
+$hr_psc =  str_repeat('-', $ph) . '+' . str_repeat('-', $sh + 1)
+           . '+' . str_repeat('-', $ch) . "\n";
+$hr_ipsd = str_repeat('-', $ih) . '+' . str_repeat('-', $ph + 1)
+           . '+' . str_repeat('-', $sh + 1) . '+' . str_repeat('-', $dh) . "\n";
+$hre_ipsd = "\n" . str_repeat(' ', $ih) . '|' . str_repeat(' ', $ph + 1)
+           . '|' . str_repeat(' ', $sh + 1) . '| ';
 
 /**
  * Text output.
@@ -31,7 +46,7 @@ echo 'Generated at: ' . THIS_DATE . "\n"
 echo "\n";
 
 /**
- * Priority | Count
+ * Priority | Count.
  */
 echo $hr_pc;
 printf(P_HEADER . '| ' . C_HEADER . "\n",  'Priority', 'Count');
@@ -49,7 +64,7 @@ echo "\n";
 echo "\n";
 
 /**
- * Status | Count
+ * Status | Count.
  */
 echo $hr_sc;
 printf(S_HEADER . '| ' . C_HEADER . "\n",  'Status', 'Count');
@@ -67,7 +82,7 @@ echo "\n";
 echo "\n";
 
 /**
- * Priority | Status | Count
+ * Priority | Status | Count.
  */
 echo $hr_psc;
 printf(P_HEADER . '| ' . S_HEADER . '| ' . C_HEADER . "\n",  'Priority', 'Status', 'Count');
@@ -81,4 +96,28 @@ while ($row = mysql_fetch_assoc($res_pri
 echo $hr_psc;
 printf(P_HEADER . '| ' . S_HEADER . '| ' . C_VALUE . "\n", 'All', '', $sum);
 
+echo "\n";
+echo "\n";
+
+/**
+ * Id | Priority | Status | Short description.
+ */
+echo $hr_ipsd;
+printf(I_HEADER . '| ' . P_HEADER . '| ' . S_HEADER . '| ' . D_HEADER . "\n",
+       'Id', 'Priority', 'Status', 'Short description');
+echo $hr_ipsd;
+
+$sum = 0;
+while ($row = mysql_fetch_assoc($res_last_seven)) {
+    $sum++;
+    $sdesc = wordwrap($row['sdesc'], $dh - 1, $hre_ipsd);
+
+    printf(I_HEADER . '| ' . P_HEADER . '| ' . S_HEADER . '| ' . D_HEADER . "\n",
+           $row['id'], $row['priority'], $row['status'], $sdesc);
+}
+echo $hr_ipsd;
+printf(I_HEADER . '| ' . P_HEADER . '| ' . S_HEADER . '| ' . D_HEADER . "\n",
+       'All', '', '', $sum);
+
+echo "\n";
 ?>

=== modified file 'falcon_bug_statistic/include/fbs_query.php'
--- a/falcon_bug_statistic/include/fbs_query.php	2008-06-30 08:51:27 +0000
+++ b/falcon_bug_statistic/include/fbs_query.php	2008-06-30 13:21:56 +0000
@@ -59,8 +59,13 @@ $sql_prio_stat =  "SELECT priority, stat
                        AND bug_type = 'Server: Falcon'
                      GROUP BY priority, status";
 
+$date_last_seven = date('Y-m-d',time() - 60 * 60 * 24 * 8);
+$sql_last_seven = "SELECT id, priority, status, sdesc FROM bugdb
+                     WHERE bug_type = 'Server: Falcon'
+                       AND ts1 > '$date_last_seven'";
 
 $res_prio = mysql_query($sql_prio);
 $res_stat = mysql_query($sql_stat);
 $res_prio_stat = mysql_query($sql_prio_stat);
+$res_last_seven = mysql_query($sql_last_seven);
 ?>

Thread
bzr commit into mysql-falcon branch (hakan:213) Hakan Kuecuekyilmaz1 Jul