summaryrefslogtreecommitdiffstats
path: root/query.cgi
diff options
context:
space:
mode:
authorjustdave%bugzilla.org <>2004-07-07 15:02:32 +0200
committerjustdave%bugzilla.org <>2004-07-07 15:02:32 +0200
commitcb425931262e9c087a99709ec2a215efeb766311 (patch)
tree2caa1afc3e3a22fa8613286471e83a532a7c2b41 /query.cgi
parent301233f8df92dcb3b84c38ebe707716179e1d419 (diff)
downloadbugzilla-cb425931262e9c087a99709ec2a215efeb766311.tar.gz
bugzilla-cb425931262e9c087a99709ec2a215efeb766311.tar.xz
Bug 245077: The "Find a specific bug" tab is now the default query when you go to query.cgi. To keep the developers happy, a cookie is now set to remember which query page you last visited, and going to query.cgi without specifying which tab will get you the last one you visited.
Patch by Byron Jones <bugzilla@glob.com.au> r=justdave, a=justdave
Diffstat (limited to 'query.cgi')
-rwxr-xr-xquery.cgi25
1 files changed, 21 insertions, 4 deletions
diff --git a/query.cgi b/query.cgi
index a37fc9125..c97c07eed 100755
--- a/query.cgi
+++ b/query.cgi
@@ -22,6 +22,7 @@
# David Gardiner <david.gardiner@unisa.edu.au>
# Matthias Radestock <matthias@sorted.org>
# Gervase Markham <gerv@gerv.net>
+# Byron Jones <bugzilla@glob.com.au>
use strict;
use lib ".";
@@ -395,16 +396,32 @@ if (($::FORM{'query_format'} || $::FORM{'format'} || "") eq "create-series") {
# Add in the defaults.
$vars->{'default'} = \%default;
-$vars->{'format'} = $::FORM{'format'};
-$vars->{'query_format'} = $::FORM{'query_format'};
+$vars->{'format'} = $cgi->param('format');
+$vars->{'query_format'} = $cgi->param('query_format');
+
+# Set default page to "specific" if none proviced
+if (!($cgi->param('query_format') || $cgi->param('format'))) {
+ if (defined $cgi->cookie('DEFAULTFORMAT')) {
+ $vars->{'format'} = $cgi->cookie('DEFAULTFORMAT');
+ } else {
+ $vars->{'format'} = 'specific';
+ }
+}
+
+# Set cookie from format unless it's a report
+if ($vars->{'format'} !~ /^report-/i) {
+ $cgi->send_cookie(-name => 'DEFAULTFORMAT',
+ -value => $vars->{'format'},
+ -expires => "Fri, 01-Jan-2038 00:00:00 GMT");
+}
# Generate and return the UI (HTML page) from the appropriate template.
# If we submit back to ourselves (for e.g. boolean charts), we need to
# preserve format information; hence query_format taking priority over
# format.
my $format = GetFormat("search/search",
- $::FORM{'query_format'} || $::FORM{'format'},
- $::FORM{'ctype'});
+ $vars->{'query_format'} || $vars->{'format'},
+ $cgi->param('ctype'));
print $cgi->header($format->{'ctype'});