summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortravis%sedsystems.ca <>2005-01-19 01:53:50 +0100
committertravis%sedsystems.ca <>2005-01-19 01:53:50 +0100
commit014b25fed9a4a44963c63582b177fd8ac0ea438f (patch)
tree0a0e004fab30a94cb60462314536590567ae02de
parent47552954db6be6abcf3c27339fdb1063637c0066 (diff)
downloadbugzilla-014b25fed9a4a44963c63582b177fd8ac0ea438f.tar.gz
bugzilla-014b25fed9a4a44963c63582b177fd8ac0ea438f.tar.xz
Bug 276840 : Move $::defaultqueryname out of globals.pl into Bugzilla/Constants.pm
Patch by Max K-A <mkanat@kerio.com> r=vladd a=justdave
-rw-r--r--Bugzilla/Constants.pm5
-rwxr-xr-xbuglist.cgi3
-rw-r--r--globals.pl2
-rwxr-xr-xquery.cgi8
4 files changed, 10 insertions, 8 deletions
diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm
index 7e22ed2f7..768b0e684 100644
--- a/Bugzilla/Constants.pm
+++ b/Bugzilla/Constants.pm
@@ -63,6 +63,7 @@ use base qw(Exporter);
GROUP_VISIBLE
DEFAULT_COLUMN_LIST
+ DEFAULT_QUERY_NAME
);
@Bugzilla::Constants::EXPORT_OK = qw(contenttypes);
@@ -207,4 +208,8 @@ use constant DEFAULT_COLUMN_LIST => (
"bug_status", "resolution", "short_short_desc"
);
+# Used by query.cgi and buglist.cgi as the named-query name
+# for the default settings.
+use constant DEFAULT_QUERY_NAME => '(Default query)';
+
1;
diff --git a/buglist.cgi b/buglist.cgi
index 6df402781..8abfc6869 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -44,7 +44,6 @@ require "CGI.pl";
use vars qw($db_name
@components
- $defaultqueryname
@legal_keywords
@legal_platform
@legal_priority
@@ -340,7 +339,7 @@ elsif (($::FORM{'cmdtype'} eq "doit") && $::FORM{'remtype'}) {
if ($::FORM{'remtype'} eq "asdefault") {
Bugzilla->login(LOGIN_REQUIRED);
my $userid = Bugzilla->user->id;
- my $qname = SqlQuote($::defaultqueryname);
+ my $qname = SqlQuote(DEFAULT_QUERY_NAME);
my $qbuffer = SqlQuote($::buffer);
SendSQL("LOCK TABLES namedqueries WRITE");
diff --git a/globals.pl b/globals.pl
index 095ada57d..5c7da1a15 100644
--- a/globals.pl
+++ b/globals.pl
@@ -41,7 +41,6 @@ use Bugzilla::BugMail;
sub globals_pl_sillyness {
my $zz;
$zz = @main::default_column_list;
- $zz = $main::defaultqueryname;
$zz = @main::enterable_products;
$zz = %main::keywordsbyname;
$zz = @main::legal_bug_status;
@@ -95,7 +94,6 @@ $::ENV{'PATH'} = '';
$::SIG{TERM} = 'IGNORE';
$::SIG{PIPE} = 'IGNORE';
-$::defaultqueryname = "(Default query)"; # This string not exposed in UI
$::unconfirmedstate = "UNCONFIRMED";
# The following subroutine is for debugging purposes only.
diff --git a/query.cgi b/query.cgi
index 0faf156cb..2de7e1727 100755
--- a/query.cgi
+++ b/query.cgi
@@ -76,7 +76,7 @@ if ($userid) {
}
}
if (defined $cgi->cookie('DEFAULTQUERY')) {
- push(@oldquerycookies, [$::defaultqueryname, 'DEFAULTQUERY',
+ push(@oldquerycookies, [DEFAULT_QUERY_NAME, 'DEFAULTQUERY',
$cgi->cookie('DEFAULTQUERY')]);
}
if (@oldquerycookies) {
@@ -104,7 +104,7 @@ if ($userid) {
if ($::FORM{'nukedefaultquery'}) {
if ($userid) {
SendSQL("DELETE FROM namedqueries " .
- "WHERE userid = $userid AND name = '$::defaultqueryname'");
+ "WHERE userid = $userid AND name = " . SqlQuote(DEFAULT_QUERY_NAME));
}
$::buffer = "";
}
@@ -112,7 +112,7 @@ if ($::FORM{'nukedefaultquery'}) {
my $userdefaultquery;
if ($userid) {
SendSQL("SELECT query FROM namedqueries " .
- "WHERE userid = $userid AND name = '$::defaultqueryname'");
+ "WHERE userid = $userid AND name = " . SqlQuote(DEFAULT_QUERY_NAME));
$userdefaultquery = FetchOneColumn();
}
@@ -391,7 +391,7 @@ $default{'charts'} = \@charts;
if ($userid) {
my @namedqueries;
SendSQL("SELECT name FROM namedqueries " .
- "WHERE userid = $userid AND name != '$::defaultqueryname' " .
+ "WHERE userid = $userid AND name != " . SqlQuote(DEFAULT_QUERY_NAME) .
"ORDER BY name");
while (MoreSQLData()) {
push(@namedqueries, FetchOneColumn());