summaryrefslogtreecommitdiffstats
path: root/describekeywords.cgi
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2006-07-02 01:45:53 +0200
committermkanat%bugzilla.org <>2006-07-02 01:45:53 +0200
commitf301c9241af577f8f3df94338f1329d91c82d252 (patch)
treeaff46880248e76011b2a3d6afa793be7117e9154 /describekeywords.cgi
parent0fd94fa00dc3429814a97c106f2ff0a0550e6ac0 (diff)
downloadbugzilla-f301c9241af577f8f3df94338f1329d91c82d252.tar.gz
bugzilla-f301c9241af577f8f3df94338f1329d91c82d252.tar.xz
Bug 343248: SQL query to get all keywords with bug count is duplicated in editkeywords.cgi and describekeywords.cgi
Patch By Remi Zara <remi_zara@mac.com> r=mkanat, a=justdave
Diffstat (limited to 'describekeywords.cgi')
-rwxr-xr-xdescribekeywords.cgi14
1 files changed, 2 insertions, 12 deletions
diff --git a/describekeywords.cgi b/describekeywords.cgi
index e06350d2e..12c57ea7f 100755
--- a/describekeywords.cgi
+++ b/describekeywords.cgi
@@ -27,25 +27,15 @@ use lib ".";
use Bugzilla;
use Bugzilla::Error;
use Bugzilla::User;
+use Bugzilla::Keyword;
Bugzilla->login();
my $cgi = Bugzilla->cgi;
-my $dbh = Bugzilla->dbh;
my $template = Bugzilla->template;
my $vars = {};
-my $keywords = $dbh->selectall_arrayref(
- q{SELECT keyworddefs.name, keyworddefs.description,
- COUNT(keywords.bug_id) AS bugcount
- FROM keyworddefs
- LEFT JOIN keywords
- ON keyworddefs.id = keywords.keywordid } .
- $dbh->sql_group_by('keyworddefs.id',
- 'keyworddefs.name, keyworddefs.description') .
- " ORDER BY keyworddefs.name", {'Slice' => {}});
-
-$vars->{'keywords'} = $keywords;
+$vars->{'keywords'} = Bugzilla::Keyword->get_all_with_bug_count();
$vars->{'caneditkeywords'} = UserInGroup("editkeywords");
print Bugzilla->cgi->header();