diff options
-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; } |