summaryrefslogtreecommitdiffstats
path: root/enter_bug.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-09-03 06:12:07 +0200
committerlpsolit%gmail.com <>2005-09-03 06:12:07 +0200
commit6b44875b901ac8d1d7383fed017c973a9f954051 (patch)
tree0b43db0b62321cc03c91caad4810d4660c2fd56c /enter_bug.cgi
parent3c36f0414886baad1a59db8d0dbd0efd3fec2254 (diff)
downloadbugzilla-6b44875b901ac8d1d7383fed017c973a9f954051.tar.gz
bugzilla-6b44875b901ac8d1d7383fed017c973a9f954051.tar.xz
Bug 286158: Remove GetSelectableProducts() from globals.pl and use Bugzilla::User::get_selectable_products() instead - Patch by Frédéric Buclin <LpSolit@gmail.com> r=joel,kiko a=justdave
Diffstat (limited to 'enter_bug.cgi')
-rwxr-xr-xenter_bug.cgi18
1 files changed, 5 insertions, 13 deletions
diff --git a/enter_bug.cgi b/enter_bug.cgi
index 4a32a32e7..66e182423 100755
--- a/enter_bug.cgi
+++ b/enter_bug.cgi
@@ -80,21 +80,13 @@ if (!defined $product || $product eq "") {
}
if (!$cgi->param('classification')) {
- my %classdesc;
- my %classifications;
-
- foreach my $c (GetSelectableClassifications()) {
- $classdesc{$c} = $::classdesc{$c};
- $classifications{$c} = $::classifications{$c};
- }
+ my $classifications = Bugzilla->user->get_selectable_classifications();
- my $classification_size = scalar(keys %classdesc);
- if ($classification_size == 0) {
+ if (scalar(@$classifications) == 0) {
ThrowUserError("no_products");
}
- elsif ($classification_size > 1) {
- $vars->{'classdesc'} = \%classdesc;
- $vars->{'classifications'} = \%classifications;
+ elsif (scalar(@$classifications) > 1) {
+ $vars->{'classifications'} = $classifications;
$vars->{'target'} = "enter_bug.cgi";
$vars->{'format'} = $cgi->param('format');
@@ -106,7 +98,7 @@ if (!defined $product || $product eq "") {
|| ThrowTemplateError($template->error());
exit;
}
- $cgi->param(-name => 'classification', -value => (keys %classdesc)[0]);
+ $cgi->param(-name => 'classification', -value => @$classifications[0]->name);
}
my %products;