]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Add a way to remove a default query that you may have set.
authorterry%mozilla.org <>
Mon, 24 Jan 2000 01:14:09 +0000 (01:14 +0000)
committerterry%mozilla.org <>
Mon, 24 Jan 2000 01:14:09 +0000 (01:14 +0000)
query.cgi

index 27e7adbfbdc9a9874a931e2781f1c3c03a97f665..2abb98a42006d7a88f7f2d0d4b30795a468b26a6 100755 (executable)
--- a/query.cgi
+++ b/query.cgi
@@ -58,7 +58,16 @@ if (defined $::FORM{"GoAheadAndLogIn"}) {
     confirm_login();
 }
 
+if ($::FORM{'nukedefaultquery'}) {
+    print "Set-Cookie: DEFAULTQUERY= ; path=/; expires=Sun, 30-Jun-80 00:00:00 GMT\n";
+    delete $::COOKIE{"DEFAULTQUERY"};
+    $::buffer = "";
+}
+
+
+my $userdefaultquery = 1;
 if (!defined $::COOKIE{"DEFAULTQUERY"}) {
+    $userdefaultquery = 0;
     $::COOKIE{"DEFAULTQUERY"} = Param("defaultquery");
 }
 
@@ -611,15 +620,23 @@ if ($::COOKIE{'LASTORDER'}) {
     $deforder = "Reuse same sort as last time";
     unshift(@orders, $deforder);
 }
-    
+
+my $defquerytype = $userdefaultquery ? "my" : "the";
+
 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>
-<BR>Give me a <A HREF=\"help.html\">clue</A> about how to use this form.
-</FORM>
+<INPUT TYPE=\"reset\" VALUE=\"Reset back to $defquerytype default query\">
+";
+
+if ($userdefaultquery) {
+    print qq{<BR><A HREF="query.cgi?nukedefaultquery=1">Set my default query back to the system default</A>};
+}
 
+print "
+</FORM>
+<P>Give me a <A HREF=\"help.html\">clue</A> about how to use this form.
+<P>
 ";