From aac2ea969174d3d6d62d89b49e5c002cdc4f6a02 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Mon, 31 Oct 2005 05:42:12 +0000 Subject: Bug 153445: Do not display bug counts by default when listing products in editproducts.cgi - Patch by Frédéric Buclin r=GavinS a=justdave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- editproducts.cgi | 10 ++++----- template/en/default/admin/products/list.html.tmpl | 27 ++++++++++++++++++----- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/editproducts.cgi b/editproducts.cgi index 7b2123697..b4007a2f4 100755 --- a/editproducts.cgi +++ b/editproducts.cgi @@ -53,6 +53,7 @@ use vars qw(@legal_bug_status @legal_resolution); my $user = Bugzilla->login(LOGIN_REQUIRED); my $whoid = $user->id; +my $dbh = Bugzilla->dbh; my $cgi = Bugzilla->cgi; my $template = Bugzilla->template; my $vars = {}; @@ -70,7 +71,7 @@ $user->in_group('editcomponents') my $classification_name = trim($cgi->param('classification') || ''); my $product_name = trim($cgi->param('product') || ''); my $action = trim($cgi->param('action') || ''); -my $dbh = Bugzilla->dbh; +my $showbugcounts = (defined $cgi->param('showbugcounts')); # # product = '' -> Show nice list of classifications (if @@ -112,12 +113,11 @@ if (!$action && !$product_name) { @products = Bugzilla::Product::get_all_products; } - $vars->{'products'} = \@products; + $vars->{'products'} = \@products; + $vars->{'showbugcounts'} = $showbugcounts; - $template->process("admin/products/list.html.tmpl", - $vars) + $template->process("admin/products/list.html.tmpl", $vars) || ThrowTemplateError($template->error()); - exit; } diff --git a/template/en/default/admin/products/list.html.tmpl b/template/en/default/admin/products/list.html.tmpl index 17eb61c0d..ee76a3b0a 100644 --- a/template/en/default/admin/products/list.html.tmpl +++ b/template/en/default/admin/products/list.html.tmpl @@ -20,6 +20,7 @@ # classification: Bugzilla::Classification object; If classifications # are enabled, then this is # the currently selected classification + # showbugcounts: boolean; true if bug counts should be included in the table #%] [% PROCESS global/variables.none.tmpl %] @@ -78,19 +79,26 @@ name => "votestoconfirm" heading => "Votes To Confirm" align => 'right' - }, - { + } ] +%] + +[% IF showbugcounts %] + + [% columns.push({ name => "bug_count" heading => "$terms.Bug Count" align => 'right' contentlink => bug_count_contentlink - }, - { + }) + %] + +[% END %] + +[% columns.push({ heading => "Action" content => "Delete" contentlink => delete_contentlink - }, - ] + }) %] [% overrides.disallow_new = [ { @@ -114,6 +122,13 @@

+[% IF !showbugcounts %] + +

+ Redisplay table with [% terms.bug %] counts (slower)

+ +[% END %] + [% PROCESS admin/products/footer.html.tmpl no_edit_other_products_link = 1 %] -- cgit v1.2.3-24-g4f1b