describekeywords.cgi 881 Bytes
Newer Older
1
#!/usr/bin/perl -wT
2 3 4
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
#
6 7
# This Source Code Form is "Incompatible With Secondary Licenses", as
# defined by the Mozilla Public License, v. 2.0.
8 9

use strict;
10
use lib qw(. lib);
11

12
use Bugzilla;
13
use Bugzilla::Error;
14
use Bugzilla::User;
15
use Bugzilla::Keyword;
16

17
my $user = Bugzilla->login();
18

19
my $cgi = Bugzilla->cgi;
20 21
my $template = Bugzilla->template;
my $vars = {};
22

23 24 25
# Run queries against the shadow DB.
Bugzilla->switch_to_shadow_db;

26
$vars->{'keywords'} = Bugzilla::Keyword->get_all_with_bug_count();
27
$vars->{'caneditkeywords'} = $user->in_group("editkeywords");
28

29
print $cgi->header();
30 31
$template->process("reports/keywords.html.tmpl", $vars)
  || ThrowTemplateError($template->error());