summaryrefslogtreecommitdiffstats
path: root/editflagtypes.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2009-01-01 20:04:52 +0100
committerlpsolit%gmail.com <>2009-01-01 20:04:52 +0100
commit14620dc7279cbbde4236ec4319ed0669f41aa68f (patch)
tree8ce72bb44e436994e701f6f0793408fedccb195b /editflagtypes.cgi
parent032b9593468a41cb6911f4f4e3eaebdfa2fb0ad9 (diff)
downloadbugzilla-14620dc7279cbbde4236ec4319ed0669f41aa68f.tar.gz
bugzilla-14620dc7279cbbde4236ec4319ed0669f41aa68f.tar.xz
Bug 471771: editflagtypes.cgi should display the number of flags per type - Patch by Frédéric Buclin <LpSolit@gmail.com> r=justdave a=LpSolit
Diffstat (limited to 'editflagtypes.cgi')
-rwxr-xr-xeditflagtypes.cgi15
1 files changed, 15 insertions, 0 deletions
diff --git a/editflagtypes.cgi b/editflagtypes.cgi
index 4117c91e8..d77c6b8a3 100755
--- a/editflagtypes.cgi
+++ b/editflagtypes.cgi
@@ -100,6 +100,7 @@ sub list {
my $component = validateComponent($product, scalar $cgi->param('component'));
my $product_id = $product ? $product->id : 0;
my $component_id = $component ? $component->id : 0;
+ my $show_flag_counts = (defined $cgi->param('show_flag_counts')) ? 1 : 0;
# Define the variables and functions that will be passed to the UI template.
$vars->{'selected_product'} = $cgi->param('product');
@@ -140,6 +141,20 @@ sub list {
'group' => scalar $cgi->param('group')});
}
+ if ($show_flag_counts) {
+ my %bug_lists;
+ my %map = ('+' => 'granted', '-' => 'denied', '?' => 'pending');
+
+ foreach my $flagtype (@$bug_flagtypes, @$attach_flagtypes) {
+ $bug_lists{$flagtype->id} = {};
+ my $flags = Bugzilla::Flag->match({type_id => $flagtype->id});
+ # Build lists of bugs, triaged by flag status.
+ map { push(@{$bug_lists{$flagtype->id}->{$map{$_->status}}}, $_->bug_id) } @$flags;
+ }
+ $vars->{'bug_lists'} = \%bug_lists;
+ $vars->{'show_flag_counts'} = 1;
+ }
+
$vars->{'bug_types'} = $bug_flagtypes;
$vars->{'attachment_types'} = $attach_flagtypes;