diff options
author | lpsolit%gmail.com <> | 2005-09-03 04:12:07 +0000 |
---|---|---|
committer | lpsolit%gmail.com <> | 2005-09-03 04:12:07 +0000 |
commit | 6b44875b901ac8d1d7383fed017c973a9f954051 (patch) | |
tree | 0b43db0b62321cc03c91caad4810d4660c2fd56c /template/en | |
parent | 3c36f0414886baad1a59db8d0dbd0efd3fec2254 (diff) | |
download | bugs-6b44875b901ac8d1d7383fed017c973a9f954051.tar bugs-6b44875b901ac8d1d7383fed017c973a9f954051.tar.gz bugs-6b44875b901ac8d1d7383fed017c973a9f954051.tar.bz2 bugs-6b44875b901ac8d1d7383fed017c973a9f954051.tar.xz bugs-6b44875b901ac8d1d7383fed017c973a9f954051.zip |
Bug 286158: Remove GetSelectableProducts() from globals.pl and use Bugzilla::User::get_selectable_products() instead - Patch by Frédéric Buclin <LpSolit@gmail.com> r=joel,kiko a=justdave
Diffstat (limited to 'template/en')
-rw-r--r-- | template/en/default/config.js.tmpl | 8 | ||||
-rw-r--r-- | template/en/default/config.rdf.tmpl | 60 | ||||
-rw-r--r-- | template/en/default/filterexceptions.pl | 2 | ||||
-rw-r--r-- | template/en/default/global/choose-classification.html.tmpl | 16 | ||||
-rw-r--r-- | template/en/default/reports/duplicates.html.tmpl | 8 | ||||
-rw-r--r-- | template/en/default/request/queue.html.tmpl | 21 |
6 files changed, 61 insertions, 54 deletions
diff --git a/template/en/default/config.js.tmpl b/template/en/default/config.js.tmpl index e3ec91435..00ba58983 100644 --- a/template/en/default/config.js.tmpl +++ b/template/en/default/config.js.tmpl @@ -73,10 +73,10 @@ var component = new Object(); var version = new Object(); var target_milestone = new Object(); -[% FOREACH p = legal_products %] - component['[% p FILTER js %]'] = [ [% FOREACH x = components_by_product.$p %]'[% x FILTER js %]', [% END %] ]; - version['[% p FILTER js %]'] = [ [% FOREACH x = versions_by_product.$p %]'[% x FILTER js %]', [% END %] ]; - target_milestone['[% p FILTER js %]'] = [ [% FOREACH x = milestones_by_product.$p %]'[% x FILTER js %]', [% END %] ]; +[% FOREACH p = products %] + component['[% p.name FILTER js %]'] = [ [% FOREACH x = p.components %]'[% x.name FILTER js %]', [% END %] ]; + version['[% p.name FILTER js %]'] = [ [% FOREACH x = p.versions %]'[% x.name FILTER js %]', [% END %] ]; + target_milestone['[% p.name FILTER js %]'] = [ [% FOREACH x = p.milestones %]'[% x.name FILTER js %]', [% END %] ]; [% END %] // Product and Component Exceptions diff --git a/template/en/default/config.rdf.tmpl b/template/en/default/config.rdf.tmpl index 27a7ba3a0..4c1047f50 100644 --- a/template/en/default/config.rdf.tmpl +++ b/template/en/default/config.rdf.tmpl @@ -105,23 +105,23 @@ <bz:products> <Seq> - [% FOREACH product = legal_products %] + [% FOREACH product = products %] <li> - <bz:product rdf:about="[% Param('urlbase') %]product.cgi?name=[% product FILTER uri %]"> - <bz:name>[% product FILTER html %]</bz:name> + <bz:product rdf:about="[% Param('urlbase') %]product.cgi?name=[% product.name FILTER uri %]"> + <bz:name>[% product.name FILTER html %]</bz:name> <bz:components> <Seq> - [% FOREACH component = components_by_product.$product %] - <li resource="[% Param('urlbase') %]component.cgi?name=[% component FILTER uri %]"/> + [% FOREACH component = product.components %] + <li resource="[% Param('urlbase') %]component.cgi?name=[% component.name FILTER uri %]"/> [% END %] </Seq> </bz:components> <bz:versions> <Seq> - [% FOREACH version = versions_by_product.$product %] - <li resource="[% Param('urlbase') %]version.cgi?name=[% version FILTER uri %]"/> + [% FOREACH version = product.versions %] + <li resource="[% Param('urlbase') %]version.cgi?name=[% version.name FILTER uri %]"/> [% END %] </Seq> </bz:versions> @@ -129,8 +129,8 @@ [% IF Param('usetargetmilestone') %] <bz:target_milestones> <Seq> - [% FOREACH milestone = milestones_by_product.$product %] - <li resource="[% Param('urlbase') %]milestone.cgi?name=[% milestone FILTER uri %]"/> + [% FOREACH milestone = product.milestones %] + <li resource="[% Param('urlbase') %]milestone.cgi?name=[% milestone.name FILTER uri %]"/> [% END %] </Seq> </bz:target_milestones> @@ -144,24 +144,28 @@ <bz:components> <Seq> - [% FOREACH item = legal_components %] - <li> - <bz:component rdf:about="[% Param('urlbase') %]component.cgi?name=[% item FILTER uri %]"> - <bz:name>[% item FILTER html %]</bz:name> - </bz:component> - </li> + [% FOREACH product = products %] + [% FOREACH component = product.components %] + <li> + <bz:component rdf:about="[% Param('urlbase') %]component.cgi?name=[% component.name FILTER uri %]"> + <bz:name>[% component.name FILTER html %]</bz:name> + </bz:component> + </li> + [% END %] [% END %] </Seq> </bz:components> <bz:versions> <Seq> - [% FOREACH item = legal_versions %] - <li> - <bz:version rdf:about="[% Param('urlbase') %]version.cgi?name=[% item FILTER uri %]"> - <bz:name>[% item FILTER html %]</bz:name> - </bz:version> - </li> + [% FOREACH product = products %] + [% FOREACH version = product.versions %] + <li> + <bz:version rdf:about="[% Param('urlbase') %]version.cgi?name=[% version.name FILTER uri %]"> + <bz:name>[% version.name FILTER html %]</bz:name> + </bz:version> + </li> + [% END %] [% END %] </Seq> </bz:versions> @@ -169,12 +173,14 @@ [% IF Param('usetargetmilestone') %] <bz:target_milestones> <Seq> - [% FOREACH item = legal_milestones %] - <li> - <bz:target_milestone rdf:about="[% Param('urlbase') %]milestone.cgi?name=[% item FILTER uri %]"> - <bz:name>[% item FILTER html %]</bz:name> - </bz:target_milestone> - </li> + [% FOREACH product = products %] + [% FOREACH milestone = product.milestones %] + <li> + <bz:target_milestone rdf:about="[% Param('urlbase') %]milestone.cgi?name=[% milestone.name FILTER uri %]"> + <bz:name>[% milestone.name FILTER html %]</bz:name> + </bz:target_milestone> + </li> + [% END %] [% END %] </Seq> </bz:target_milestones> diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl index 8ed71f008..28ea2c7ba 100644 --- a/template/en/default/filterexceptions.pl +++ b/template/en/default/filterexceptions.pl @@ -244,7 +244,7 @@ ], 'global/choose-classification.html.tmpl' => [ - 'classdesc.$p', + 'class.description', ], 'global/choose-product.html.tmpl' => [ diff --git a/template/en/default/global/choose-classification.html.tmpl b/template/en/default/global/choose-classification.html.tmpl index b2021f234..627ac860f 100644 --- a/template/en/default/global/choose-classification.html.tmpl +++ b/template/en/default/global/choose-classification.html.tmpl @@ -18,8 +18,8 @@ #%] [%# INTERFACE: - # classdesc: hash. May be empty. The hash keys are the classifications, and the values - # are their descriptions. + # classifications: an array of classification objects containing + # at least one product accessible by the user. #%] [% IF target == "enter_bug.cgi" %] @@ -45,21 +45,19 @@ </tr> [% END %] -[% FOREACH p = classdesc.keys.sort %] - [% IF classifications.$p.size > 0 %] +[% FOREACH class = classifications %] <tr> <th align="right" valign="top"> - <a href="[% target FILTER url_quote %]?classification=[% p FILTER url_quote -%] + <a href="[% target FILTER url_quote %]?classification=[% class.name FILTER url_quote -%] [%- IF cloned_bug_id %]&cloned_bug_id=[% cloned_bug_id FILTER url_quote %][% END -%] [%- IF format %]&format=[% format FILTER url_quote %][% END %]"> - [% p FILTER html %]</a>: + [% class.name FILTER html %]</a>: </th> - [% IF classdesc.$p %] - <td valign="top"> [% classdesc.$p %]</td> + [% IF class.description %] + <td valign="top"> [% class.description %]</td> [% END %] </tr> - [% END %] [% END %] </table> diff --git a/template/en/default/reports/duplicates.html.tmpl b/template/en/default/reports/duplicates.html.tmpl index 5cbf84fe2..897bbf17f 100644 --- a/template/en/default/reports/duplicates.html.tmpl +++ b/template/en/default/reports/duplicates.html.tmpl @@ -20,7 +20,7 @@ #%] [%# INTERFACE: - # products: list of strings. The products this user can see. + # products: an array of product objects this user can see. # # sortby: string. the column on which we are sorting the buglist. # reverse: boolean. True if we are reversing the current sort. @@ -84,9 +84,9 @@ <td rowspan="4" valign="top"> <select name="product" size="5" multiple="multiple"> [% FOREACH p = products %] - <option name="[% p FILTER html %]" - [% " selected" IF lsearch(query_products, p) != -1 %] - >[% p FILTER html %]</option> + <option name="[% p.name FILTER html %]" + [% " selected" IF lsearch(query_products, p.name) != -1 %] + >[% p.name FILTER html %]</option> [% END %] </select> </td> diff --git a/template/en/default/request/queue.html.tmpl b/template/en/default/request/queue.html.tmpl index a6edcd8a3..73bbd8195 100644 --- a/template/en/default/request/queue.html.tmpl +++ b/template/en/default/request/queue.html.tmpl @@ -30,9 +30,9 @@ var first_load = 1; // is this the first time we load the page? var last_sel = []; // caches last selection var cpts = new Array(); - [% FOREACH p = products %] - cpts['[% p FILTER js %]'] = [ - [%- FOREACH item = components_by_product.$p %]'[% item FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%] ]; + [% FOREACH prod = products %] + cpts['[% prod.name FILTER js %]'] = [ + [%- FOREACH comp = prod.components %]'[% comp.name FILTER js %]'[% ", " UNLESS loop.last %] [%- END -%] ]; [% END %] [% END %] @@ -58,9 +58,10 @@ <td> <select name="product" onchange="selectProduct(this.form, 'product', 'component', 'Any');"> <option value="">Any</option> - [% FOREACH item = products %] - <option value="[% item FILTER html %]" - [% "selected" IF cgi.param('product') == item %]>[% item FILTER html %]</option> + [% FOREACH prod = products %] + <option value="[% prod.name FILTER html %]" + [% "selected" IF cgi.param('product') == prod.name %]> + [% prod.name FILTER html %]</option> [% END %] </select> </td> @@ -92,9 +93,11 @@ <td> <select name="component"> <option value="">Any</option> - [% FOREACH item = components %] - <option value="[% item FILTER html %]" [% "selected" IF cgi.param('component') == item %]> - [% item FILTER html %]</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 %] [% END %] </select> </td> |