[bugzilla-gnome-org-extensions] describe user: Port to GnomeAttachmentStatus



commit 870dcc524917153ea740c3bf275e53d154cfb7d0
Author: Krzesimir Nowak <qdlacz gmail com>
Date:   Sun Nov 9 23:18:22 2014 +0100

    describe user: Port to GnomeAttachmentStatus

 DescribeUser/lib/Util.pm |   44 ++++++++++++++++++++------------------------
 TODO                     |    3 +++
 2 files changed, 23 insertions(+), 24 deletions(-)
---
diff --git a/DescribeUser/lib/Util.pm b/DescribeUser/lib/Util.pm
index 1c47e06..16793d2 100644
--- a/DescribeUser/lib/Util.pm
+++ b/DescribeUser/lib/Util.pm
@@ -143,30 +143,26 @@ sub _page_describeuser {
 
     $vars->{'developed_products'} = _developed_products($r_user);
 
-    my $sth;
-    my @patches;
-    # XXX - relies on attachments.status!
-    if ($dbh->bz_column_info('attachments', 'status')) {
-        $sth = $dbh->prepare("
-                SELECT attachments.bug_id, attachments.status as status,
-                       attachments.attach_id, products.name as product,
-                       attachments.description
-                  FROM attachments, bugs, products
-                 WHERE attachments.bug_id = bugs.bug_id
-                   AND bugs.product_id = products.id
-                   AND bugs.bug_status IN ('UNCONFIRMED','NEW','ASSIGNED','REOPENED')
-                   AND attachments.submitter_id = ?
-                   AND attachments.ispatch='1'
-                   AND attachments.isobsolete != '1'
-                   AND attachments.status IN ('accepted-commit_after_freeze',
-                                          'accepted-commit_now', 'needs-work', 'none',
-                                          'rejected', 'reviewed')
-              ORDER BY attachments.status");
-
-        $sth->execute($r_userid);
-        while (my $patch = $sth->fetchrow_hashref) {
-            push(@patches, $patch);
-        }
+    my $sth = $dbh->prepare("
+            SELECT attachments.bug_id, attachments.gnome_attachment_status as status,
+                   attachments.attach_id, products.name as product,
+                   attachments.description
+              FROM attachments, bugs, products
+             WHERE attachments.bug_id = bugs.bug_id
+               AND bugs.product_id = products.id
+               AND bugs.bug_status IN ('UNCONFIRMED','NEW','ASSIGNED','REOPENED')
+               AND attachments.submitter_id = ?
+               AND attachments.ispatch='1'
+               AND attachments.isobsolete != '1'
+               AND attachments.gnome_attachment_status IN ('accepted-commit_after_freeze',
+                                      'accepted-commit_now', 'needs-work', 'none',
+                                      'rejected', 'reviewed')
+          ORDER BY attachments.gnome_attachment_status");
+
+    $sth->execute($r_userid);
+    my @patches = ();
+    while (my $patch = $sth->fetchrow_hashref) {
+        push(@patches, $patch);
     }
     $vars->{'patches'} = \ patches;
 
diff --git a/TODO b/TODO
index 1338678..5cf5306 100644
--- a/TODO
+++ b/TODO
@@ -3,3 +3,6 @@
 - Weekly status page (https://bugzilla.gnome.org/page.cgi?id=weekly-bug-summary.html)
 - Browse page (https://bugzilla.gnome.org/browse.cgi?product=Evolution)
 - Describe user page (https://bugzilla.gnome.org/page.cgi?id=describeuser.html)
+- Describe User:
+  Instead of listing all possible attachment statuses, just get all of
+  them and remove 'committed' from the list.


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