]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 430398: request.cgi does not filter component select list on distinct values...
authordkl%redhat.com <>
Wed, 14 May 2008 08:34:24 +0000 (08:34 +0000)
committerdkl%redhat.com <>
Wed, 14 May 2008 08:34:24 +0000 (08:34 +0000)
request.cgi
template/en/default/request/queue.html.tmpl

index c854a176799b5b047bea760334e38a269459db2c..cad1f6f533d656a2fa7db0d000a71fb311d65541 100755 (executable)
@@ -76,6 +76,15 @@ else {
     $vars->{'products'} = $user->get_selectable_products;
     $vars->{'types'} = \@types;
     $vars->{'requests'} = {};
+
+    my %components;
+    foreach my $prod (@{$vars->{'products'}}) {
+        foreach my $comp (@{$prod->components}) {
+            $components{$comp->name} = 1;
+        }
+    }
+    $vars->{'components'} = [ sort { $a cmp $b } keys %components ];
+
     $template->process('request/queue.html.tmpl', $vars)
       || ThrowTemplateError($template->error());
 }
@@ -307,6 +316,14 @@ sub queue {
     $vars->{'requests'} = \@requests;
     $vars->{'types'} = \@types;
 
+    my %components;
+    foreach my $prod (@{$vars->{'products'}}) {
+        foreach my $comp (@{$prod->components}) {
+            $components{$comp->name} = 1;
+        }
+    }
+    $vars->{'components'} = [ sort { $a cmp $b } keys %components ];
+
     # Generate and return the UI (HTML page) from the appropriate template.
     $template->process("request/queue.html.tmpl", $vars)
       || ThrowTemplateError($template->error());
index 0d626a2e12b93f85856dab79640dd470b0f58350..af911b2efaf9f9377a5930ba64ba3704e849dad0 100644 (file)
@@ -89,11 +89,9 @@ to some group are shown by default.
       <td>
         <select name="component">
           <option value="">Any</option>
-          [% FOREACH prod = products %]
-            [% FOREACH comp = prod.components %]
-              <option value="[% comp.name FILTER html %]" [% "selected" IF cgi.param('component') == comp.name %]>
-                [% comp.name FILTER html %]</option>
-            [% END %]
+          [% FOREACH comp = components %]
+            <option value="[% comp FILTER html %]" [% "selected" IF cgi.param('component') == comp %]>
+              [% comp FILTER html %]</option>
           [% END %]
         </select>
       </td>