summaryrefslogtreecommitdiffstats
path: root/query.cgi
diff options
context:
space:
mode:
authorAlbert Ting <altlist@gmail.com>2015-01-08 18:49:25 +0100
committerDylan William Hardison <dylan@hardison.net>2015-01-13 16:06:54 +0100
commit8762d1e68c4ea2343f445bb4beb46c1ae04586b1 (patch)
treeb26119ae24f924c50ca50a57dbedd2c6780e3d1b /query.cgi
parentcde1c5854904f8989e39a217b1d4f02c9204428e (diff)
downloadbugzilla-8762d1e68c4ea2343f445bb4beb46c1ae04586b1.tar.gz
bugzilla-8762d1e68c4ea2343f445bb4beb46c1ae04586b1.tar.xz
Bug 832095 - Request new buglist/query hooks
Diffstat (limited to 'query.cgi')
-rwxr-xr-xquery.cgi14
1 files changed, 8 insertions, 6 deletions
diff --git a/query.cgi b/query.cgi
index faf670d23..fab90eb2d 100755
--- a/query.cgi
+++ b/query.cgi
@@ -95,7 +95,7 @@ my $userdefaultquery;
if ($userid) {
$userdefaultquery = $dbh->selectrow_array(
"SELECT query FROM namedqueries " .
- "WHERE userid = ? AND name = ?",
+ "WHERE userid = ? AND name = ?",
undef, ($userid, DEFAULT_QUERY_NAME));
}
@@ -128,7 +128,7 @@ sub PrefillForm {
next if grep { $_ eq $name } @skip;
$foundone = 1;
my @values = $buf->param($name);
-
+
# If the name is a single letter followed by numbers, it's part
# of Custom Search. We store these as an array of hashes.
if ($name =~ /^([[:lower:]])(\d+)$/) {
@@ -158,9 +158,9 @@ if (!PrefillForm($buffer)) {
}
}
-# if using groups for entry, then we don't want people to see products they
+# if using groups for entry, then we don't want people to see products they
# don't have access to. Remove them from the list.
-my @selectable_products = sort {lc($a->name) cmp lc($b->name)}
+my @selectable_products = sort {lc($a->name) cmp lc($b->name)}
@{$user->get_selectable_products};
Bugzilla::Product::preload(\@selectable_products);
$vars->{'product'} = \@selectable_products;
@@ -297,10 +297,12 @@ if (defined($vars->{'format'}) && IsValidQueryType($vars->{'format'})) {
# If we submit back to ourselves (for e.g. boolean charts), we need to
# preserve format information; hence query_format taking priority over
# format.
-my $format = $template->get_format("search/search",
- $vars->{'query_format'} || $vars->{'format'},
+my $format = $template->get_format("search/search",
+ $vars->{'query_format'} || $vars->{'format'},
scalar $cgi->param('ctype'));
+Bugzilla::Hook::process("query_format", {'vars' => $vars, 'format' => $format});
+
print $cgi->header($format->{'ctype'});
$template->process($format->{'template'}, $vars)