]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 221900: duplicates.cgi query fails if more than one product selected; patch by...
authorjocuri%softhome.net <>
Sun, 26 Oct 2003 22:01:04 +0000 (22:01 +0000)
committerjocuri%softhome.net <>
Sun, 26 Oct 2003 22:01:04 +0000 (22:01 +0000)
duplicates.cgi
template/en/default/reports/duplicates-table.html.tmpl
template/en/default/reports/duplicates.html.tmpl

index 27333cbabec898fa1b178e65bee16586f63cffaa..fb54972182503fe867574632e834977639070358 100755 (executable)
@@ -78,16 +78,16 @@ my $changedsince = formvalue("changedsince", 7);
 my $maxrows = formvalue("maxrows", 100);
 my $openonly = formvalue("openonly");
 my $reverse = formvalue("reverse") ? 1 : 0;
-my $product = formvalue("product");
+my @query_products = $cgi->param('product');
 my $sortvisible = formvalue("sortvisible");
 my @buglist = (split(/[:,]/, formvalue("bug_id")));
 
 my $product_id;
-if ($product) {
-    $product_id = get_product_id($product);
+foreach my $p (@query_products) {
+    $product_id = get_product_id($p);
     if (!$product_id) {
         ThrowUserError("invalid_product_name",
-                       { product => $product });
+                       { product => $p });
     }
 }
 
@@ -209,7 +209,7 @@ if (scalar(%count)) {
 
     # Restrict to product if requested
     if ($::FORM{'product'}) {
-        $params->param('product', $::FORM{'product'});
+        $params->param('product', join(',', @query_products));
     }
 
     my $query = new Bugzilla::Search('fields' => [qw(bugs.bug_id
@@ -258,7 +258,7 @@ $vars->{'maxrows'} = $maxrows;
 $vars->{'openonly'} = $openonly;
 $vars->{'reverse'} = $reverse;
 $vars->{'format'} = $::FORM{'format'};
-$vars->{'product'} = $product;
+$vars->{'query_products'} = \@query_products;
 $vars->{'products'} = \@::legal_product;
 
 
index 34e070f10131048e85c6839847ed871bdc8436ed..d2205f2c05e6878661a476045e83b7a0c2f8aec9 100644 (file)
@@ -39,7 +39,7 @@
   # maxrows: integer. Max number of rows to display.
   # changedsince: integer. The number of days ago for the changedsince column.
   # openonly: boolean. True if we are only showing open bugs.
-  # product: string. Restrict to this product only.
+  # query_products: list of strings. Restrict to these products only.
   #%]
 
 [% PROCESS global/variables.none.tmpl %]
@@ -78,7 +78,7 @@
                 [% "&amp;maxrows=$maxrows" IF maxrows %]
                 [% "&amp;changedsince=$changedsince" IF changedsince %]
                 [% "&amp;openonly=1" IF openonly %]
-                [% IF product %]&amp;product=[% product FILTER html %][% END %]
+                [% FOREACH p = query_products %]&amp;product=[% p FILTER html %][% END %]
                 [% IF format %]&amp;format=[% format FILTER html %][% END %]
                 [% "&amp;bug_id=$bug_ids_string&amp;sortvisible=1" 
                                                             IF sortvisible %]">
index bff971f89a198f2af534e281080d1edb5f6bc176..fb3184cf6922af648af2bb31da83d731a8157cf1 100644 (file)
@@ -27,7 +27,7 @@
   # maxrows: integer. Max number of rows to display.
   # changedsince: integer. The number of days ago for the changedsince column.
   # openonly: boolean. True if we are only showing open bugs.
-  # product: string. Restrict to this product only.
+  # query_products: list of strings. The set of products we check for dups.
   #
   # Additionally, you need to fulfill the interface to
   # duplicates-table.html.tmpl.
@@ -35,8 +35,8 @@
 
 [% PROCESS global/variables.none.tmpl %]
 
-[% IF product %]
-  [% title = "Most Frequently Reported $terms.Bugs for $product" %]
+[% IF query_products.size %]
+  [% title = "Most Frequently Reported $terms.Bugs for ${query_products.join(', ')}" %]
 [% ELSE %]
   [% title = "Most Frequently Reported $terms.Bugs" %]
 [% END%]
@@ -85,7 +85,8 @@
         <select name="product" size="5" multiple="multiple">
           [% FOREACH p = products %]
             <option name="[% p FILTER html %]"
-            [% " selected" IF product == p %]>[% p FILTER html %]</option>
+            [% " selected" IF lsearch(query_products, p) != -1 %]
+            >[% p FILTER html %]</option>
           [% END %]
         </select>
       </td>