From cb425931262e9c087a99709ec2a215efeb766311 Mon Sep 17 00:00:00 2001 From: "justdave%bugzilla.org" <> Date: Wed, 7 Jul 2004 13:02:32 +0000 Subject: 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 r=justdave, a=justdave --- query.cgi | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) (limited to 'query.cgi') diff --git a/query.cgi b/query.cgi index a37fc9125..c97c07eed 100755 --- a/query.cgi +++ b/query.cgi @@ -22,6 +22,7 @@ # David Gardiner # Matthias Radestock # Gervase Markham +# Byron Jones 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'}); -- cgit v1.2.3-24-g4f1b