Commit 28aebb4c authored by dkl%redhat.com's avatar dkl%redhat.com

Bug 430398: request.cgi does not filter component select list on distinct values…

Bug 430398: request.cgi does not filter component select list on distinct values - Patch by David Lawrence <dkl@redhat.com> r/a=LpSolit
parent dc57a411
...@@ -76,6 +76,15 @@ else { ...@@ -76,6 +76,15 @@ else {
$vars->{'products'} = $user->get_selectable_products; $vars->{'products'} = $user->get_selectable_products;
$vars->{'types'} = \@types; $vars->{'types'} = \@types;
$vars->{'requests'} = {}; $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) $template->process('request/queue.html.tmpl', $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
} }
...@@ -307,6 +316,14 @@ sub queue { ...@@ -307,6 +316,14 @@ sub queue {
$vars->{'requests'} = \@requests; $vars->{'requests'} = \@requests;
$vars->{'types'} = \@types; $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. # Generate and return the UI (HTML page) from the appropriate template.
$template->process("request/queue.html.tmpl", $vars) $template->process("request/queue.html.tmpl", $vars)
|| ThrowTemplateError($template->error()); || ThrowTemplateError($template->error());
......
...@@ -89,11 +89,9 @@ to some group are shown by default. ...@@ -89,11 +89,9 @@ to some group are shown by default.
<td> <td>
<select name="component"> <select name="component">
<option value="">Any</option> <option value="">Any</option>
[% FOREACH prod = products %] [% FOREACH comp = components %]
[% FOREACH comp = prod.components %] <option value="[% comp FILTER html %]" [% "selected" IF cgi.param('component') == comp %]>
<option value="[% comp.name FILTER html %]" [% "selected" IF cgi.param('component') == comp.name %]> [% comp FILTER html %]</option>
[% comp.name FILTER html %]</option>
[% END %]
[% END %] [% END %]
</select> </select>
</td> </td>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment