summaryrefslogtreecommitdiffstats
path: root/buglist.cgi
diff options
context:
space:
mode:
authorterry%mozilla.org <>2000-01-25 16:53:26 +0100
committerterry%mozilla.org <>2000-01-25 16:53:26 +0100
commit0230a614c04af4633fd9cb3d9216b720d474a4b7 (patch)
tree69468f51e04ac6caccd0d1a19229d6bea1abb65b /buglist.cgi
parent5fc31978bdcfe2790ee48d930d1c2adafe66b204 (diff)
downloadbugzilla-0230a614c04af4633fd9cb3d9216b720d474a4b7.tar.gz
bugzilla-0230a614c04af4633fd9cb3d9216b720d474a4b7.tar.xz
Reworked preferences UI. Added ability to turn off "My bugs" link at
bottom. Made "My bugs" show bugs you own AND bugs you submitted. Added ability to display your named queries in the footer. Many random bugfixes.
Diffstat (limited to 'buglist.cgi')
-rwxr-xr-xbuglist.cgi15
1 files changed, 12 insertions, 3 deletions
diff --git a/buglist.cgi b/buglist.cgi
index f096bd323..6427180e9 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -141,9 +141,17 @@ individual query.
PutFooter();
exit();
}
- SendSQL("REPLACE INTO namedqueries (userid, name, query) VALUES " .
- "($userid, " . SqlQuote($name) .
- ", " . SqlQuote($::buffer) . ")");
+ $::buffer =~ s/[\&\?]cmdtype=[a-z]+//;
+ my $qname = SqlQuote($name);
+ SendSQL("SELECT query FROM namedqueries " .
+ "WHERE userid = $userid AND name = $qname");
+ if (!FetchOneColumn()) {
+ SendSQL("REPLACE INTO namedqueries (userid, name, query) " .
+ "VALUES ($userid, $qname, " . SqlQuote($::buffer) . ")");
+ } else {
+ SendSQL("UPDATE namedqueries SET query = " . SqlQuote($::buffer) .
+ " WHERE userid = $userid AND name = $qname");
+ }
PutHeader("OK, query saved.");
print qq{
OK, you have a new query named <code>$name</code>
@@ -874,6 +882,7 @@ if ($count == 0) {
print qq{<p><A HREF="query.cgi">Query Page</A>\n};
print qq{&nbsp;&nbsp;<A HREF="enter_bug.cgi">Enter New Bug</A>\n};
+ print qq{<NOBR><A HREF="query.cgi?$::buffer">Edit this query</A></NOBR>\n};
} elsif ($count == 1) {
print "One bug found.\n";
} else {