Commit aac2ea96 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 153445: Do not display bug counts by default when listing products in…

Bug 153445: Do not display bug counts by default when listing products in editproducts.cgi - Patch by Frédéric Buclin <LpSolit@gmail.com> r=GavinS a=justdave
parent 1254fcb8
...@@ -53,6 +53,7 @@ use vars qw(@legal_bug_status @legal_resolution); ...@@ -53,6 +53,7 @@ use vars qw(@legal_bug_status @legal_resolution);
my $user = Bugzilla->login(LOGIN_REQUIRED); my $user = Bugzilla->login(LOGIN_REQUIRED);
my $whoid = $user->id; my $whoid = $user->id;
my $dbh = Bugzilla->dbh;
my $cgi = Bugzilla->cgi; my $cgi = Bugzilla->cgi;
my $template = Bugzilla->template; my $template = Bugzilla->template;
my $vars = {}; my $vars = {};
...@@ -70,7 +71,7 @@ $user->in_group('editcomponents') ...@@ -70,7 +71,7 @@ $user->in_group('editcomponents')
my $classification_name = trim($cgi->param('classification') || ''); my $classification_name = trim($cgi->param('classification') || '');
my $product_name = trim($cgi->param('product') || ''); my $product_name = trim($cgi->param('product') || '');
my $action = trim($cgi->param('action') || ''); my $action = trim($cgi->param('action') || '');
my $dbh = Bugzilla->dbh; my $showbugcounts = (defined $cgi->param('showbugcounts'));
# #
# product = '' -> Show nice list of classifications (if # product = '' -> Show nice list of classifications (if
...@@ -112,12 +113,11 @@ if (!$action && !$product_name) { ...@@ -112,12 +113,11 @@ if (!$action && !$product_name) {
@products = Bugzilla::Product::get_all_products; @products = Bugzilla::Product::get_all_products;
} }
$vars->{'products'} = \@products; $vars->{'products'} = \@products;
$vars->{'showbugcounts'} = $showbugcounts;
$template->process("admin/products/list.html.tmpl", $template->process("admin/products/list.html.tmpl", $vars)
$vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
exit; exit;
} }
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
# classification: Bugzilla::Classification object; If classifications # classification: Bugzilla::Classification object; If classifications
# are enabled, then this is # are enabled, then this is
# the currently selected classification # the currently selected classification
# showbugcounts: boolean; true if bug counts should be included in the table
#%] #%]
[% PROCESS global/variables.none.tmpl %] [% PROCESS global/variables.none.tmpl %]
...@@ -78,19 +79,26 @@ ...@@ -78,19 +79,26 @@
name => "votestoconfirm" name => "votestoconfirm"
heading => "Votes To Confirm" heading => "Votes To Confirm"
align => 'right' align => 'right'
}, } ]
{ %]
[% IF showbugcounts %]
[% columns.push({
name => "bug_count" name => "bug_count"
heading => "$terms.Bug Count" heading => "$terms.Bug Count"
align => 'right' align => 'right'
contentlink => bug_count_contentlink contentlink => bug_count_contentlink
}, })
{ %]
[% END %]
[% columns.push({
heading => "Action" heading => "Action"
content => "Delete" content => "Delete"
contentlink => delete_contentlink contentlink => delete_contentlink
}, })
]
%] %]
[% overrides.disallow_new = [ { [% overrides.disallow_new = [ {
...@@ -114,6 +122,13 @@ ...@@ -114,6 +122,13 @@
<p> <p>
[% IF !showbugcounts %]
<p><a href="editproducts.cgi?showbugcounts=1[% classification_url_part %]">
Redisplay table with [% terms.bug %] counts (slower)</a></p>
[% END %]
[% PROCESS admin/products/footer.html.tmpl [% PROCESS admin/products/footer.html.tmpl
no_edit_other_products_link = 1 no_edit_other_products_link = 1
%] %]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment