diff options
author | justdave%bugzilla.org <> | 2004-07-07 13:02:32 +0000 |
---|---|---|
committer | justdave%bugzilla.org <> | 2004-07-07 13:02:32 +0000 |
commit | cb425931262e9c087a99709ec2a215efeb766311 (patch) | |
tree | 2caa1afc3e3a22fa8613286471e83a532a7c2b41 /query.cgi | |
parent | 301233f8df92dcb3b84c38ebe707716179e1d419 (diff) | |
download | bugs-cb425931262e9c087a99709ec2a215efeb766311.tar bugs-cb425931262e9c087a99709ec2a215efeb766311.tar.gz bugs-cb425931262e9c087a99709ec2a215efeb766311.tar.bz2 bugs-cb425931262e9c087a99709ec2a215efeb766311.tar.xz bugs-cb425931262e9c087a99709ec2a215efeb766311.zip |
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-x | query.cgi | 25 |
1 files changed, 21 insertions, 4 deletions
@@ -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'}); |