summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CGI.pl1
-rwxr-xr-xbuglist.cgi27
-rwxr-xr-xquery.cgi16
3 files changed, 39 insertions, 5 deletions
diff --git a/CGI.pl b/CGI.pl
index ecd56860a..4ad0064f3 100644
--- a/CGI.pl
+++ b/CGI.pl
@@ -268,6 +268,7 @@ sub navigation_header {
} else {
print "<I><FONT COLOR=\#777777>Next</FONT></I>\n";
}
+ print qq{&nbsp;&nbsp;<A HREF="buglist.cgi?regetlastlist=1">Show list</A>\n};
}
print "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF=query.cgi>Query page</A>\n";
print "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF=enter_bug.cgi>Enter new bug</A>\n"
diff --git a/buglist.cgi b/buglist.cgi
index 6f791a6df..488944fb4 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -29,7 +29,6 @@ use Date::Parse;
use vars %::MFORM,
@::components,
- @::db,
@::default_column_list,
@::keywordsbyname,
@::legal_keywords,
@@ -45,6 +44,7 @@ use vars %::MFORM,
ConnectToDatabase();
+# print "Content-type: text/plain\n\n"; # Handy for debugging.
if (!defined $::FORM{'cmdtype'}) {
# This can happen if there's an old bookmark to a query...
@@ -250,6 +250,23 @@ and bugs.version = projector.value
and bugs.groupset & $::usergroupset = bugs.groupset
";
+if ($::FORM{'regetlastlist'}) {
+ if (!$::COOKIE{'BUGLIST'}) {
+ print qq{
+Sorry, I seem to have lost the cookie that recorded the results of your last
+query. You will have to start over at the <A HREF="query.cgi">query page</A>.
+};
+ PutTrailer();
+ exit;
+ }
+ my @list = split(/:/, $::COOKIE{'BUGLIST'});
+ $::MFORM{'bug_id'} = \@list;
+ $::FORM{'bug_id'} = join('', $::MFORM{'bug_id'});
+ if (!$::FORM{'order'}) {
+ $::FORM{'order'} = 'reuse last sort';
+ }
+}
+
if ((defined $::FORM{'emailcc1'} && $::FORM{'emailcc1'}) ||
(defined $::FORM{'emailcc2'} && $::FORM{'emailcc2'})) {
@@ -532,7 +549,11 @@ foreach my $f ("short_desc", "long_desc", "bug_file_loc",
$query .= "group by bugs.bug_id\n";
+
if (defined $::FORM{'order'} && $::FORM{'order'} ne "") {
+ if ($::COOKIE{'LASTORDER'} && $::FORM{'order'} =~ /^reuse/i) {
+ $::FORM{'order'} = url_decode($::COOKIE{'LASTORDER'});
+ }
$query .= "order by ";
$::FORM{'order'} =~ s/votesum/bugs.votes/; # Silly backwards compatability
# hack.
@@ -732,6 +753,10 @@ if ($serverpush) {
# Note! HTML header not yet closed
}
my $toolong = 0;
+if ($::FORM{'order'}) {
+ my $q = url_quote($::FORM{'order'});
+ print "Set-Cookie: LASTORDER=$q ; path=/; expires=Sun, 30-Jun-2029 00:00:00 GMT\n";
+}
if (length($buglist) < 4000) {
print "Set-Cookie: BUGLIST=$buglist\n\n";
} else {
diff --git a/query.cgi b/query.cgi
index f8728e9c9..b032a2860 100755
--- a/query.cgi
+++ b/query.cgi
@@ -593,10 +593,18 @@ print "
<NOBR><B>Sort By:</B>
<SELECT NAME=\"order\">
- <OPTION>Bug Number
- <OPTION SELECTED>\"Importance\"
- <OPTION>Assignee
-</SELECT></NOBR>
+";
+
+my $deforder = "'Importance'";
+my @orders = ('Bug Number', $deforder, 'Assignee');
+
+if ($::COOKIE{'LASTORDER'}) {
+ $deforder = "Reuse same sort as last time";
+ unshift(@orders, $deforder);
+}
+
+print make_options(\@orders, $deforder);
+print "</SELECT></NOBR>
<INPUT TYPE=\"submit\" VALUE=\"Submit query\">
<INPUT TYPE=\"reset\" VALUE=\"Reset back to the default query\">
<INPUT TYPE=hidden name=form_name VALUE=query>