$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());
}
$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());
<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>