From 8762d1e68c4ea2343f445bb4beb46c1ae04586b1 Mon Sep 17 00:00:00 2001 From: Albert Ting Date: Thu, 8 Jan 2015 12:49:25 -0500 Subject: Bug 832095 - Request new buglist/query hooks --- query.cgi | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'query.cgi') 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) -- cgit v1.2.3-24-g4f1b