[bugzilla-gnome-org-customizations] [Browse] Remove NEEDINFO section; just put a single query in sidebar



commit c6259dbed3b25942fd2d33b284cd649c5ced81fd
Author: Andre Klapper <a9016009 gmx de>
Date:   Wed Feb 11 00:59:33 2015 +0100

    [Browse] Remove NEEDINFO section; just put a single query in sidebar
    
    Apart from triagers as a target group there is no real need to
    differentiate on five levels of age for tickets in NEEDINFO status.
    The previous visibility and space used by that was not justified.
    
    Put one single query in the sidebar for any NEEDINFO tickets in
    that product, sort the search results of that query by oldest
    tickets first, and force displaying the Last Changed column on
    those results so it becomes clear how old tickets are.

 extensions/Browse/lib/Util.pm                      |   52 +++++++-----------
 .../template/en/default/pages/browse.html.tmpl     |   58 +++-----------------
 2 files changed, 27 insertions(+), 83 deletions(-)
---
diff --git a/extensions/Browse/lib/Util.pm b/extensions/Browse/lib/Util.pm
index 2ebb848..b729a7a 100644
--- a/extensions/Browse/lib/Util.pm
+++ b/extensions/Browse/lib/Util.pm
@@ -25,6 +25,7 @@ use base qw(Exporter);
 our @EXPORT = qw(
     page
     total_open_bugs
+    total_needinfo_bugs
     what_new_means
     new_bugs
     new_patches
@@ -34,7 +35,6 @@ our @EXPORT = qw(
     string_bugs
     by_patch_status
     by_version
-    needinfo_split
     by_target
     by_priority
     by_severity
@@ -225,13 +225,14 @@ sub _page_browse {
         }
     }
 
-    $vars->{'classifications'}  = \ classifications;
-    $vars->{'product'}          = $product;
-    $vars->{'total_open_bugs'}  = total_open_bugs($product);
-    $vars->{'what_new_means'}   = what_new_means();
-    $vars->{'new_bugs'}         = new_bugs($product);
-    $vars->{'new_patches'}      = new_patches($product);
-    $vars->{'no_response_bugs'} = scalar(@{no_response_bugs($product)});
+    $vars->{'classifications'}      = \ classifications;
+    $vars->{'product'}              = $product;
+    $vars->{'total_open_bugs'}      = total_open_bugs($product);
+    $vars->{'total_needinfo_bugs'}  = total_needinfo_bugs($product);
+    $vars->{'what_new_means'}       = what_new_means();
+    $vars->{'new_bugs'}             = new_bugs($product);
+    $vars->{'new_patches'}          = new_patches($product);
+    $vars->{'no_response_bugs'}     = scalar(@{no_response_bugs($product)});
 
     my $keyword = Bugzilla::Keyword->new({ name => 'gnome-love' });
     if ($keyword) {
@@ -259,7 +260,6 @@ sub _page_browse {
     $vars->{'by_component'}       = by_component($product);
     $vars->{'target_development'} = gnome_target_development();
     $vars->{'target_stable'}      = gnome_target_stable();
-    $vars->{'needinfo_split'}     = needinfo_split($product);
 
     ($vars->{'blockers_stable'}, $vars->{'blockers_development'}) = list_blockers($product);
 
@@ -290,6 +290,16 @@ sub total_open_bugs {
                                          AND product_id = ?", undef, $product->id);
 }
 
+sub total_needinfo_bugs {
+    my $product = shift;
+    my $dbh = Bugzilla->dbh;
+
+    return $dbh->selectrow_array("SELECT COUNT(bug_id)
+                                    FROM bugs
+                                   WHERE bug_status = 'NEEDINFO'
+                                         AND product_id = ?", undef, $product->id);
+}
+
 sub what_new_means {
     my $dbh = Bugzilla->dbh;
     return $dbh->selectrow_array("SELECT " . $dbh->sql_date_math('LOCALTIMESTAMP(0)', '-', 7, 'DAY'));
@@ -413,30 +423,6 @@ sub by_version {
     return \ result;
 }
 
-sub needinfo_split {
-    my $product = shift;
-    my $dbh = Bugzilla->dbh;
-
-    my $ni_a = Bugzilla::Search::SqlifyDate('-2w');
-    my $ni_b = Bugzilla::Search::SqlifyDate('-4w');
-    my $ni_c = Bugzilla::Search::SqlifyDate('-3m');
-    my $ni_d = Bugzilla::Search::SqlifyDate('-6m');
-    my $ni_e = Bugzilla::Search::SqlifyDate('-1y');
-    my $needinfo_case = "CASE WHEN delta_ts < '$ni_e' THEN 'F'
-                              WHEN delta_ts < '$ni_d' THEN 'E'
-                              WHEN delta_ts < '$ni_c' THEN 'D'
-                              WHEN delta_ts < '$ni_b' THEN 'C'
-                              WHEN delta_ts < '$ni_a' THEN 'B'
-                              ELSE 'A' END";
-
-    my %results = @{$dbh->selectcol_arrayref("SELECT $needinfo_case age, COUNT(bug_id)
-                                       FROM bugs
-                                      WHERE bug_status = 'NEEDINFO'
-                                            AND product_id = ?
-                                      GROUP BY $needinfo_case", { Columns=>[1,2] }, $product->id)};
-    return \%results;
-}
-
 sub by_target {
     my $product = shift;
     my $dbh = Bugzilla->dbh;
diff --git a/extensions/Browse/template/en/default/pages/browse.html.tmpl 
b/extensions/Browse/template/en/default/pages/browse.html.tmpl
index 353e9c0..14b2fa3 100644
--- a/extensions/Browse/template/en/default/pages/browse.html.tmpl
+++ b/extensions/Browse/template/en/default/pages/browse.html.tmpl
@@ -79,6 +79,14 @@
         [% no_response_bugs FILTER html %]</a>
     </td>
   </tr>
+
+  <tr>
+    <td>NEEDINFO [% terms.Bugs %]</td>
+    <td align="right">
+      <a href="[% buglink FILTER html 
%]&amp;bug_status=NEEDINFO&amp;columnlist=component%2Cchangeddate%2Cbug_severity%2Cpriority%2Cshort_desc&amp;order=changeddate%20DESC">
+        [%- total_needinfo_bugs FILTER html %]</a>
+    </td>
+  </tr>
   [%######################################################################
     # Temporary time-limited queries; Please just comment these out when
     # they are not in use if they will be needed again next release
@@ -327,8 +335,6 @@ Browse:
 <table cellpadding="3" cellspacing="0">
 <tr>
   <th>Milestones</th>
-  <td>&nbsp;</td>
-  <th>NEEDINFO by last changed</th>
 </tr>
 <tr>
   <td valign="top">
@@ -347,54 +353,6 @@ Browse:
   </table>
 
   </td>
-  <td>&nbsp;</td>
-  <td valign="top">
-
-  <table border="0" cellpadding="0" cellspacing="0" class="figures">
-  [% IF needinfo_split.F %]
-    <tr>
-      <td>&gt;= 1 year</a></td>
-      <td align="right"><a href="buglist.cgi?product=[% product.name FILTER uri 
%]&amp;bug_status=NEEDINFO&amp;chfieldfrom=&amp;chfieldto=-1y">
-      [% needinfo_split.F FILTER html %]</a></td>
-    </tr>
-  [% END %]
-  [% IF needinfo_split.E %]
-    <tr>
-      <td>6 months - 1 year</a></td>
-      <td align="right"><a href="buglist.cgi?product=[% product.name FILTER uri 
%]&amp;bug_status=NEEDINFO&amp;chfieldfrom=-1y&amp;chfieldto=-6m">
-      [% needinfo_split.E FILTER html %]</a></td>
-    </tr>
-  [% END %]
-  [% IF needinfo_split.D %]
-    <tr>
-      <td>3 months - 6 months</a></td>
-      <td align="right"><a href="buglist.cgi?product=[% product.name FILTER uri 
%]&amp;bug_status=NEEDINFO&amp;chfieldfrom=-6m&amp;chfieldto=-3m">
-      [% needinfo_split.D FILTER html %]</a></td>
-    </tr>
-  [% END %]
-  [% IF needinfo_split.C %]
-    <tr>
-      <td>4 weeks - 3 months</a></td>
-      <td align="right"><a href="buglist.cgi?product=[% product.name FILTER uri 
%]&amp;bug_status=NEEDINFO&amp;chfieldfrom=-3m&amp;chfieldto=-4w">
-      [% needinfo_split.C FILTER html %]</a></td>
-    </tr>
-  [% END %]
-  [% IF needinfo_split.B %]
-    <tr>
-      <td>2 weeks - 4 weeks</a></td>
-      <td align="right"><a href="buglist.cgi?product=[% product.name FILTER uri 
%]&amp;bug_status=NEEDINFO&amp;chfieldfrom=-4w&amp;chfieldto=-2w">
-      [% needinfo_split.B FILTER html %]</a></td>
-    </tr>
-  [% END %]
-  [% IF needinfo_split.A %]
-    <tr>
-      <td>&lt; 2 weeks ago</a></td>
-      <td align="right"><a href="buglist.cgi?product=[% product.name FILTER uri 
%]&amp;bug_status=NEEDINFO&amp;chfieldfrom=-2w&amp;chfieldto=">
-      [% needinfo_split.A FILTER html %]</a></td>
-    </tr>
-  [% END %]
-  </table>
-  </td>
 </tr>
 </table>
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]