]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 471633: Sort open bugs and closed bugs separately in show_bug dependson/blocks...
authorlpsolit%gmail.com <>
Wed, 21 Jan 2009 10:51:01 +0000 (10:51 +0000)
committerlpsolit%gmail.com <>
Wed, 21 Jan 2009 10:51:01 +0000 (10:51 +0000)
Bugzilla/Bug.pm

index d941a766e1c26c9d1360bf569253c1e73b14ab77..0b4e6e7943ed052ea59e7969a6b3721cdd011cba 100644 (file)
@@ -2800,12 +2800,18 @@ sub editable_bug_fields {
 
 # XXX - When Bug::update() will be implemented, we should make this routine
 #       a private method.
+# Join with bug_status and bugs tables to show bugs with open statuses first,
+# and then the others
 sub EmitDependList {
     my ($myfield, $targetfield, $bug_id) = (@_);
     my $dbh = Bugzilla->dbh;
     my $list_ref = $dbh->selectcol_arrayref(
-          "SELECT $targetfield FROM dependencies
-            WHERE $myfield = ? ORDER BY $targetfield",
+          "SELECT $targetfield
+             FROM dependencies
+                  INNER JOIN bugs ON dependencies.$targetfield = bugs.bug_id
+                  INNER JOIN bug_status ON bugs.bug_status = bug_status.value
+            WHERE $myfield = ?
+            ORDER BY is_open DESC, $targetfield",
             undef, $bug_id);
     return $list_ref;
 }