From: <psy...@us...> - 2008-10-27 18:49:26
|
Update of /cvsroot/frenchmozilla/bugzilla/template/fr/default/bug/create In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv27374/template/fr/default/bug/create Modified Files: create.html.tmpl Log Message: Bug 458436: Allow standard global select fields to control visibility of custom fields. Index: create.html.tmpl =================================================================== RCS file: /cvsroot/frenchmozilla/bugzilla/template/fr/default/bug/create/create.html.tmpl,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- create.html.tmpl 19 Sep 2008 16:44:59 -0000 1.25 +++ create.html.tmpl 27 Oct 2008 18:49:22 -0000 1.26 @@ -162,6 +162,14 @@ --> </script> +[% USE Bugzilla %] +[% SET select_fields = {} %] +[% FOREACH field = Bugzilla.get_fields( + { type => constants.FIELD_TYPE_SINGLE_SELECT, custom => 0 }) +%] + [% select_fields.${field.name} = field %] +[% END %] + <form name="Create" id="Create" method="post" action="post_bug.cgi" enctype="multipart/form-data"> <input type="hidden" name="product" value="[% product.name FILTER html %]"> @@ -235,18 +243,21 @@ </select> </td> - [% sel = { description => 'Gravité', name => 'bug_severity' } %] - [% INCLUDE select %] + [% INCLUDE bug/field.html.tmpl + bug = default, field = select_fields.bug_severity, editable = 1, + value = default.bug_severity %] </tr> <tr> - [% sel = { description => 'Plateforme', name => 'rep_platform' } %] - [% INCLUDE select %] + [% INCLUDE bug/field.html.tmpl + bug = default, field = select_fields.rep_platform, editable = 1, + value = default.rep_platform %] </tr> <tr> - [% sel = { description => 'Système d\'exploitation', name => 'op_sys' } %] - [% INCLUDE select %] + [% INCLUDE bug/field.html.tmpl + bug = default, field = select_fields.op_sys, editable = 1, + value = default.op_sys %] </tr> </tbody> @@ -260,12 +271,11 @@ [% END %] [% IF Param('letsubmitterchoosepriority') %] - [% sel = { description => 'Priorité', name => 'priority' } %] - [% INCLUDE select %] + [% INCLUDE bug/field.html.tmpl + bug = default, field = select_fields.priority, editable = 1, + value = default.priority %] [% ELSE %] - <td colspan="2"> - <input type="hidden" name="priority" value="[% default.priority FILTER html %]"> - </td> + <td colspan="2"> </td> [% END %] </tr> </tbody> @@ -437,7 +447,9 @@ [% NEXT UNLESS field.enter_bug %] [% SET value = ${field.name}.defined ? ${field.name} : "" %] <tr> - [% PROCESS bug/field.html.tmpl editable=1 value_span=3 %] + [% INCLUDE bug/field.html.tmpl + bug = default, field = field, value = value, editable = 1, + value_span = 3 %] </tr> [% END %] @@ -617,7 +629,7 @@ [% END %] <td> - <select name="[% sel.name %]"> + <select name="[% sel.name %]" id="[% sel.name %]"> [%- FOREACH x = ${sel.name} %] <option value="[% x FILTER html %]" [% " selected=\"selected\"" IF x == default.${sel.name} %]> @@ -628,5 +640,14 @@ [% END %]</option> [% END %] </select> + [% IF sel.name == "bug_status" %] + [% FOREACH controlled = select_fields.bug_status.controls_visibility_of %] + <script type="text/javascript"> + showFieldWhen('[% controlled.name FILTER js %]', + 'bug_status', + '[% controlled.visibility_value.name FILTER js %]'); + </script> + [% END %] + [% END %] </td> [% END %] |