summaryrefslogtreecommitdiffstats
path: root/buglist.cgi
diff options
context:
space:
mode:
authorSimon Green <sgreen@redhat.com>2013-11-05 00:48:48 +0100
committerSimon Green <sgreen@redhat.com>2013-11-05 00:48:48 +0100
commit5189d82750da1b7d336bedf21927970feac0ee17 (patch)
treea772ab4e75b66a50fca3def7c949ec6c740008e0 /buglist.cgi
parent7241e5286deab1bb5166ff7e713ff93f08409af0 (diff)
downloadbugzilla-5189d82750da1b7d336bedf21927970feac0ee17.tar.gz
bugzilla-5189d82750da1b7d336bedf21927970feac0ee17.tar.xz
Bug 890165 - Buglist for single component should offer "File a new bug in the XYZ component" instead of "File a new bug in the XYZ product"
r=glob, a=glob
Diffstat (limited to 'buglist.cgi')
-rwxr-xr-xbuglist.cgi16
1 files changed, 16 insertions, 0 deletions
diff --git a/buglist.cgi b/buglist.cgi
index eda2e988d..4969b1858 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -766,6 +766,7 @@ my $time_info = { 'estimated_time' => 0,
my $bugowners = {};
my $bugproducts = {};
+my $bugcomponents = {};
my $bugstatuses = {};
my @bugidlist;
@@ -798,6 +799,7 @@ foreach my $row (@$data) {
# Record the assignee, product, and status in the big hashes of those things.
$bugowners->{$bug->{'assigned_to'}} = 1 if $bug->{'assigned_to'};
$bugproducts->{$bug->{'product'}} = 1 if $bug->{'product'};
+ $bugcomponents->{$bug->{'component'}} = 1 if $bug->{'component'};
$bugstatuses->{$bug->{'bug_status'}} = 1 if $bug->{'bug_status'};
$bug->{'secure_mode'} = undef;
@@ -930,6 +932,20 @@ if ($one_product && $user->can_enter_product($one_product)) {
$vars->{'one_product'} = $one_product;
}
+# See if there's only one component in all the results (or only one component
+# that we searched for), which allows us to provide more helpful links.
+my @components = keys %$bugcomponents;
+my $one_component;
+if (scalar(@components) == 1) {
+ $vars->{one_component} = $components[0];
+}
+# This is used in the "Zarroo Boogs" case.
+elsif (my @component_input = $cgi->param('component')) {
+ if (scalar(@component_input) == 1 and $component_input[0] ne '') {
+ $vars->{one_component}= $cgi->param('component');
+ }
+}
+
# The following variables are used when the user is making changes to multiple bugs.
if ($dotweak && scalar @bugs) {
if (!$vars->{'caneditbugs'}) {