summaryrefslogtreecommitdiffstats
path: root/extensions/ProductDashboard/Extension.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2012-08-10 20:56:20 +0200
committerDave Lawrence <dlawrence@mozilla.com>2012-08-10 20:56:20 +0200
commit3524a4610f7355d1e055eb4a0dccb71ccecefc33 (patch)
treead0123e1c296733a7d8048afd8d0a91687906538 /extensions/ProductDashboard/Extension.pm
parent12070e973724b68444cb11d37bef8f0cf6e26c52 (diff)
downloadbugzilla-3524a4610f7355d1e055eb4a0dccb71ccecefc33.tar.gz
bugzilla-3524a4610f7355d1e055eb4a0dccb71ccecefc33.tar.xz
small changes to Product Dashboard
Diffstat (limited to 'extensions/ProductDashboard/Extension.pm')
-rw-r--r--extensions/ProductDashboard/Extension.pm17
1 files changed, 7 insertions, 10 deletions
diff --git a/extensions/ProductDashboard/Extension.pm b/extensions/ProductDashboard/Extension.pm
index 3b7693882..3569a13c8 100644
--- a/extensions/ProductDashboard/Extension.pm
+++ b/extensions/ProductDashboard/Extension.pm
@@ -53,20 +53,17 @@ sub _page_dashboard {
-expires => "Fri, 01-Jan-1970 00:00:00 GMT");
# If the user cannot enter bugs in any product, stop here.
- my @enterable_products = @{$user->get_enterable_products};
- ThrowUserError('no_products') unless scalar(@enterable_products);
-
- my $classification = Bugzilla->params->{'useclassification'} ?
- $input->{'classification'} : '__all';
+ scalar @{$user->get_selectable_products}
+ || ThrowUserError('no_products');
# Create data structures representing each classification
- my @classifications = ();
+ my @classifications = ();
foreach my $c (@{$user->get_selectable_classifications}) {
# Create hash to hold attributes for each classification.
- my %classification = (
- 'name' => $c->name,
+ my %classification = (
+ 'name' => $c->name,
'products' => [ @{$user->get_selectable_products($c->id)} ]
- );
+ );
# Assign hash back to classification array.
push @classifications, \%classification;
}
@@ -86,7 +83,7 @@ sub _page_dashboard {
# We need to check and make sure that the user has permission
# to enter a bug against this product.
- if (!$user->can_enter_product($product ? $product->name : $product_name)) {
+ if (!$product || !$user->can_enter_product($product->name)) {
return;
}