From 5c72835ba89910d7586a1f6b18e6e1cd0a897090 Mon Sep 17 00:00:00 2001 From: Dave Lawrence Date: Thu, 9 Aug 2012 17:10:47 -0400 Subject: Product Dashboard - Limit assignees to 25 --- extensions/ProductDashboard/Extension.pm | 2 +- extensions/ProductDashboard/lib/Queries.pm | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'extensions/ProductDashboard') diff --git a/extensions/ProductDashboard/Extension.pm b/extensions/ProductDashboard/Extension.pm index 08755da2d..3b7693882 100644 --- a/extensions/ProductDashboard/Extension.pm +++ b/extensions/ProductDashboard/Extension.pm @@ -114,7 +114,7 @@ sub _page_dashboard { if ($current_tab_name eq 'summary') { $vars->{'by_priority'} = by_priority($product, $bug_status); $vars->{'by_severity'} = by_severity($product, $bug_status); - $vars->{'by_assignee'} = by_assignee($product, $bug_status); + $vars->{'by_assignee'} = by_assignee($product, $bug_status, 25); $vars->{'by_status'} = by_status($product, $bug_status); } diff --git a/extensions/ProductDashboard/lib/Queries.pm b/extensions/ProductDashboard/lib/Queries.pm index 43d799111..63362f5bf 100644 --- a/extensions/ProductDashboard/lib/Queries.pm +++ b/extensions/ProductDashboard/lib/Queries.pm @@ -220,10 +220,12 @@ sub by_value_summary { } sub by_assignee { - my ($product, $bug_status) = @_; + my ($product, $bug_status, $limit) = @_; my $dbh = Bugzilla->dbh; my $extra; + $limit = detaint_natural($limit) ? $dbh->sql_limit($limit) : ""; + $extra = "AND bugs.bug_status IN (" . open_states() . ")" if $bug_status eq 'open'; $extra = "AND bugs.bug_status IN (" . closed_states() . ")" if $bug_status eq 'closed'; @@ -234,7 +236,8 @@ sub by_assignee { AND bugs.assigned_to = profiles.userid $extra GROUP BY profiles.login_name - ORDER BY COUNT(bugs.bug_id) DESC", undef, $product->id)}; + ORDER BY COUNT(bugs.bug_id) DESC $limit", + undef, $product->id)}; return \@result; } -- cgit v1.2.3-24-g4f1b