]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 994619 - show_bug product list is sometimes missing the actual product a bug...
authorDavid Lawrence <dkl@mozilla.com>
Wed, 16 Apr 2014 18:27:09 +0000 (18:27 +0000)
committerDavid Lawrence <dkl@mozilla.com>
Wed, 16 Apr 2014 18:27:09 +0000 (18:27 +0000)
r=gerv,a=justdave

template/en/default/global/product-select.html.tmpl
template/en/default/reports/duplicates.html.tmpl

index 8e43c9d0e4ab818b1715fbf479b0d8ea66e28bbe..ba5ce73b4c33256f1f4a8e46aa5f372f0738d099 100644 (file)
     [% END %]
 
     [% IF Param('useclassification') %]
-      [% product_ids = {} %]
+      [% classifications = {} %]
       [% IF products %]
         [% FOREACH p = products %]
-          [% key = p.id -%]
-          [% product_ids.$key = p.id -%]
+          [% IF NOT classifications.${p.classification.name}.defined %]
+            [% classifications.${p.classification.name} = [] %]
+          [% END %]
+          [% classifications.${p.classification.name}.push(p) %]
         [% END %]
-      [% END %]
-      [% FOREACH c = user.get_selectable_classifications %]
-        <optgroup label="[% c.name FILTER html %]">
+      [% ELSE %]
+        [% FOREACH c = user.get_selectable_classifications %]
+          [% classifications.${c.name} = [] %]
           [% FOREACH p = user.get_selectable_products(c.id) %]
-            [% NEXT IF (products && ! product_ids.exists(p.id)) %]
+            [% classifications.${c.name}.push(p) %]
+          [% END %]
+        [% END %]
+      [% END %]
+      [% FOREACH c = classifications.keys.sort %]
+         <optgroup label="[% c FILTER html %]">
+          [% FOREACH p = classifications.$c %]
             <option value="[% p.$valueattribute FILTER html %]"
-              [% " selected" IF (cgi.param(name) == p.name) || (value == p.name) %]>
+              [% " selected" IF (cgi.param(name) == p.name) || (value.contains(p.name)) %]>
               [% p.name FILTER html %]
             </option>
           [% END %]
         </optgroup>
       [% END %]
     [% ELSE %]
-      [% products = user.get_selectable_products UNLESS products %]
+      [% IF NOT products.defined %]
+        [% products = user.get_selectable_products %]
+      [% END %]
       [% FOREACH p = products %]
         <option value="[% p.$valueattribute FILTER html %]"
-          [% " selected" IF (cgi.param(name) == p.name) || (value == p.name) %]>
+          [% " selected" IF (cgi.param(name) == p.name) || (value.contains(p.name)) %]>
           [% p.name FILTER html %]
         </option>
       [% END %]
index 0d47aae75b0d6c53e915f0f9a6bb78eebe17681a..35c1412655ad0848ffc3f9df88524546f5ed76bb 100644 (file)
@@ -55,6 +55,7 @@
           id       => "product"
           name     => "product"
           multiple => 5
+          value    => product
         %]
       </td>
     </tr>