diff options
author | lpsolit%gmail.com <> | 2009-08-09 20:17:44 +0000 |
---|---|---|
committer | lpsolit%gmail.com <> | 2009-08-09 20:17:44 +0000 |
commit | d5ddb4373679d584ffa5524c854ce5fa3261cee8 (patch) | |
tree | 2d6264bb85c1d47bb84c769275010aa3ad38b901 | |
parent | dd6720f4af864e29e49d26befe1ec1b04a92a71c (diff) | |
download | bugs-d5ddb4373679d584ffa5524c854ce5fa3261cee8.tar bugs-d5ddb4373679d584ffa5524c854ce5fa3261cee8.tar.gz bugs-d5ddb4373679d584ffa5524c854ce5fa3261cee8.tar.bz2 bugs-d5ddb4373679d584ffa5524c854ce5fa3261cee8.tar.xz bugs-d5ddb4373679d584ffa5524c854ce5fa3261cee8.zip |
Bug 365259: The "Product" select menu in request.cgi doesn't group products by classifications - Patch by Frédéric Buclin <LpSolit@gmail.com> r=dkl a=LpSolit
-rwxr-xr-x | request.cgi | 6 | ||||
-rw-r--r-- | template/en/default/request/queue.html.tmpl | 49 |
2 files changed, 45 insertions, 10 deletions
diff --git a/request.cgi b/request.cgi index 5dfb76ddb..594ed1833 100755 --- a/request.cgi +++ b/request.cgi @@ -73,12 +73,11 @@ else { my @types = ('all', @$flagtypes); my $vars = {}; - $vars->{'products'} = $user->get_selectable_products; $vars->{'types'} = \@types; $vars->{'requests'} = {}; my %components; - foreach my $prod (@{$vars->{'products'}}) { + foreach my $prod (@{$user->get_selectable_products}) { foreach my $comp (@{$prod->components}) { $components{$comp->name} = 1; } @@ -303,14 +302,13 @@ sub queue { my $flagtypes = get_flag_types(); push(@types, @$flagtypes); - $vars->{'products'} = $user->get_selectable_products; $vars->{'excluded_columns'} = \@excluded_columns; $vars->{'group_field'} = $form_group; $vars->{'requests'} = \@requests; $vars->{'types'} = \@types; my %components; - foreach my $prod (@{$vars->{'products'}}) { + foreach my $prod (@{$user->get_selectable_products}) { foreach my $comp (@{$prod->components}) { $components{$comp->name} = 1; } diff --git a/template/en/default/request/queue.html.tmpl b/template/en/default/request/queue.html.tmpl index aa555417c..4be33ca88 100644 --- a/template/en/default/request/queue.html.tmpl +++ b/template/en/default/request/queue.html.tmpl @@ -23,8 +23,6 @@ [% USE Bugzilla %] [% cgi = Bugzilla.cgi %] -[% PROCESS "global/js-products.html.tmpl" %] - [% PROCESS global/header.html.tmpl title="Request Queue" style = " @@ -35,6 +33,31 @@ javascript_urls=["js/productform.js"] %] +<script type="text/javascript"> + var useclassification = false; // No classification level in use + var first_load = true; // Is this the first time we load the page? + var last_sel = []; // Caches last selection + var cpts = new Array(); + [% n = 1 %] + [% IF Param('useclassification') %] + [% FOREACH clas = user.get_selectable_classifications %] + [% FOREACH prod = user.get_selectable_products(clas.id) %] + [%+ PROCESS js_comp %] + [% END %] + [% END %] + [% ELSE %] + [% FOREACH prod = user.get_selectable_products %] + [%+ PROCESS js_comp %] + [% END %] + [% END %] +</script> + +[% BLOCK js_comp %] + cpts['[% n %]'] = [ + [%- FOREACH comp = prod.components %]'[% comp.name FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%]]; + [% n = n+1 %] +[% END %] + <p> When you are logged in, only requests made by you or addressed to you are shown by default. You can change the criteria using the form below. @@ -54,10 +77,24 @@ to some group are shown by default. <td> <select name="product" onchange="selectProduct(this, this.form.component, null, null, 'Any');"> <option value="">Any</option> - [% FOREACH prod = products %] - <option value="[% prod.name FILTER html %]" - [% "selected" IF cgi.param('product') == prod.name %]> - [% prod.name FILTER html %]</option> + [% IF Param('useclassification') %] + [% FOREACH c = user.get_selectable_classifications %] + <optgroup label="[% c.name FILTER html %]"> + [% FOREACH p = user.get_selectable_products(c.id) %] + <option value="[% p.name FILTER html %]" + [% " selected" IF cgi.param('product') == p.name %]> + [% p.name FILTER html %] + </option> + [% END %] + </optgroup> + [% END %] + [% ELSE %] + [% FOREACH p = user.get_selectable_products %] + <option value="[% p.name FILTER html %]" + [% " selected" IF cgi.param('product') == p.name %]> + [% p.name FILTER html %] + </option> + [% END %] [% END %] </select> </td> |