diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2012-08-09 23:10:47 +0200 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2012-08-09 23:10:47 +0200 |
commit | 5c72835ba89910d7586a1f6b18e6e1cd0a897090 (patch) | |
tree | 09c7772cc70a3f2dd9066d51e71228939c43b681 | |
parent | d70cb10238d11536904d2953daec6996e0b5493c (diff) | |
download | bugzilla-5c72835ba89910d7586a1f6b18e6e1cd0a897090.tar.gz bugzilla-5c72835ba89910d7586a1f6b18e6e1cd0a897090.tar.xz |
Product Dashboard - Limit assignees to 25
-rw-r--r-- | extensions/ProductDashboard/Extension.pm | 2 | ||||
-rw-r--r-- | extensions/ProductDashboard/lib/Queries.pm | 7 |
2 files changed, 6 insertions, 3 deletions
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; } |