summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2009-01-21 11:51:01 +0100
committerlpsolit%gmail.com <>2009-01-21 11:51:01 +0100
commitfdfe948ab5eea11a0ce98b84044308a6f95adfa0 (patch)
treeaf313d65baf9bfbdb26fccfbb44076a74fbb7169 /Bugzilla
parent4a2ceff53d05ed1a9440609c21e78364e8e8b020 (diff)
downloadbugzilla-fdfe948ab5eea11a0ce98b84044308a6f95adfa0.tar.gz
bugzilla-fdfe948ab5eea11a0ce98b84044308a6f95adfa0.tar.xz
Bug 471633: Sort open bugs and closed bugs separately in show_bug dependson/blocks lists - Patch by Nitish Bezzala <nbezzala@yahoo.com> r/a=LpSolit
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/Bug.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/Bugzilla/Bug.pm b/Bugzilla/Bug.pm
index d941a766e..0b4e6e794 100644
--- a/Bugzilla/Bug.pm
+++ b/Bugzilla/Bug.pm
@@ -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;
}