summaryrefslogtreecommitdiffstats
path: root/buglist.cgi
diff options
context:
space:
mode:
authortravis%sedsystems.ca <>2005-01-19 02:25:01 +0100
committertravis%sedsystems.ca <>2005-01-19 02:25:01 +0100
commit00aa5409017d6e0f6607e09502c8d0d470077473 (patch)
treef8fd960d30150e7e605f51715599fda1d47f49e3 /buglist.cgi
parent014b25fed9a4a44963c63582b177fd8ac0ea438f (diff)
downloadbugzilla-00aa5409017d6e0f6607e09502c8d0d470077473.tar.gz
bugzilla-00aa5409017d6e0f6607e09502c8d0d470077473.tar.xz
Bug 179451 : Move order-by generation from buglist.cgi into search.pm
Patch by Max K-A <mkanat@kerio.com> r=Joel Peshkin <bugreport@peshkin.net> a=myk
Diffstat (limited to 'buglist.cgi')
-rwxr-xr-xbuglist.cgi18
1 files changed, 8 insertions, 10 deletions
diff --git a/buglist.cgi b/buglist.cgi
index 8abfc6869..2e14c6427 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -23,6 +23,7 @@
# Stephan Niemz <st.n@gmx.net>
# Andreas Franke <afranke@mathweb.org>
# Myk Melez <myk@mozilla.org>
+# Max Kanat-Alexander <mkanat@kerio.com>
################################################################################
# Script Initialization
@@ -706,20 +707,17 @@ $db_order =~ s/$aggregate_search/actual_time/g;
$aggregate_search = quotemeta($columns->{'percentage_complete'}->{'name'});
$db_order =~ s/$aggregate_search/percentage_complete/g;
+# Now put $db_order into a format that Bugzilla::Search can use.
+# (We create $db_order as a string first because that's the way
+# we did it before Bugzilla::Search took an "order" argument.)
+my @orderstrings = split(',', $db_order);
+
# Generate the basic SQL query that will be used to generate the bug list.
my $search = new Bugzilla::Search('fields' => \@selectnames,
- 'params' => $params);
+ 'params' => $params,
+ 'order' => \@orderstrings);
my $query = $search->getSQL();
-# Extra special disgusting hack: if we are ordering by target_milestone,
-# change it to order by the sortkey of the target_milestone first.
-if ($db_order =~ /bugs.target_milestone/) {
- $db_order =~ s/bugs.target_milestone/ms_order.sortkey,ms_order.value/;
- $query =~ s/\sWHERE\s/ LEFT JOIN milestones ms_order ON ms_order.value = bugs.target_milestone AND ms_order.product_id = bugs.product_id WHERE /;
-}
-
-$query .= " ORDER BY $db_order " if ($order);
-
if ($::FORM{'limit'} && detaint_natural($::FORM{'limit'})) {
$query .= " LIMIT $::FORM{'limit'}";
}