summaryrefslogtreecommitdiffstats
path: root/buglist.cgi
diff options
context:
space:
mode:
authorgerv%gerv.net <>2003-11-09 06:49:18 +0100
committergerv%gerv.net <>2003-11-09 06:49:18 +0100
commit5f61a3d84eef44c09244996a5787bfc24621f60c (patch)
tree4d979bc6f3b04b47e0018a4929d544d0e972d782 /buglist.cgi
parentef05aed5674b707b85233a6670edb500fd70b77d (diff)
downloadbugzilla-5f61a3d84eef44c09244996a5787bfc24621f60c.tar.gz
bugzilla-5f61a3d84eef44c09244996a5787bfc24621f60c.tar.xz
Bug 179339 - Simplify and improve the stored query mechanism. Patch by gerv; r,a=myk.
Diffstat (limited to 'buglist.cgi')
-rwxr-xr-xbuglist.cgi31
1 files changed, 12 insertions, 19 deletions
diff --git a/buglist.cgi b/buglist.cgi
index 1c5161481..2183d5a79 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -274,7 +274,7 @@ if ($::FORM{'cmdtype'} eq "dorem" && $::FORM{'remaction'} =~ /^run/) {
if ($::FORM{'cmdtype'} eq "dorem") {
if ($::FORM{'remaction'} eq "run") {
$::buffer = LookupNamedQuery($::FORM{"namedcmd"});
- $vars->{'title'} = "Bug List: $::FORM{'namedcmd'}";
+ $vars->{'searchname'} = $::FORM{'namedcmd'};
$params = new Bugzilla::CGI($::buffer);
$order = $params->param('order') || $order;
}
@@ -284,17 +284,6 @@ if ($::FORM{'cmdtype'} eq "dorem") {
$params = new Bugzilla::CGI($::buffer);
$order = $params->param('order') || $order;
}
- elsif ($::FORM{'remaction'} eq "load") {
- my $url = "query.cgi?" . LookupNamedQuery($::FORM{"namedcmd"});
- print $cgi->redirect(-location=>$url);
- # Generate and return the UI (HTML page) from the appropriate template.
- $vars->{'message'} = "buglist_load_named_query";
- $vars->{'namedcmd'} = $::FORM{'namedcmd'};
- $vars->{'url'} = $url;
- $template->process("global/message.html.tmpl", $vars)
- || ThrowTemplateError($template->error());
- exit;
- }
elsif ($::FORM{'remaction'} eq "forget") {
confirm_login();
my $userid = DBNameToIdAndCheck($::COOKIE{"Bugzilla_login"});
@@ -314,18 +303,18 @@ if ($::FORM{'cmdtype'} eq "dorem") {
exit;
}
}
-elsif ($::FORM{'cmdtype'} eq "doit" && $::FORM{'remember'}) {
- if ($::FORM{'remember'} == 1 && $::FORM{'remtype'} eq "asdefault") {
+elsif ($::FORM{'cmdtype'} eq "doit") {
+ if ($::FORM{'remtype'} eq "asdefault") {
confirm_login();
my $userid = DBNameToIdAndCheck($::COOKIE{"Bugzilla_login"});
my $qname = SqlQuote($::defaultqueryname);
my $qbuffer = SqlQuote($::buffer);
SendSQL("REPLACE INTO namedqueries (userid, name, query)
VALUES ($userid, $qname, $qbuffer)");
- # Generate and return the UI (HTML page) from the appropriate template.
+
$vars->{'message'} = "buglist_new_default_query";
}
- elsif ($::FORM{'remember'} == 1 && $::FORM{'remtype'} eq "asnamed") {
+ elsif ($::FORM{'remtype'} eq "asnamed") {
confirm_login();
my $userid = DBNameToIdAndCheck($::COOKIE{"Bugzilla_login"});
@@ -334,10 +323,9 @@ elsif ($::FORM{'cmdtype'} eq "doit" && $::FORM{'remember'}) {
$name !~ /[<>&]/ || ThrowUserError("illegal_query_name");
my $qname = SqlQuote($name);
- $::buffer =~ s/[\&\?]cmdtype=[a-z]+//;
- my $qbuffer = SqlQuote($::buffer);
+ my $qbuffer = SqlQuote($::FORM{'newquery'});
- my $tofooter = $::FORM{'tofooter'} ? 1 : 0;
+ my $tofooter = 1;
$vars->{'message'} = "buglist_new_named_query";
@@ -363,6 +351,11 @@ elsif ($::FORM{'cmdtype'} eq "doit" && $::FORM{'remember'}) {
Bugzilla->user->flush_queries_cache();
$vars->{'queryname'} = $name;
+
+ print "Content-Type: text/html\n\n";
+ $template->process("global/message.html.tmpl", $vars)
+ || ThrowTemplateError($template->error());
+ exit;
}
}