From a9822ceefb563a54420f13b2395b8c1359833778 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Sat, 25 Oct 2008 04:14:56 +0000 Subject: Bug 458436: Allow standard global select fields to control visibility of custom fields Patch By Max Kanat-Alexander r=bbaetz, a=mkanat --- template/en/default/bug/create/create.html.tmpl | 48 ++++++++++++++++++------- 1 file changed, 35 insertions(+), 13 deletions(-) (limited to 'template/en/default/bug/create/create.html.tmpl') diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl index aaf2de5a6..0b941cc35 100644 --- a/template/en/default/bug/create/create.html.tmpl +++ b/template/en/default/bug/create/create.html.tmpl @@ -162,6 +162,14 @@ function handleWantsAttachment(wants_attachment) { --> +[% USE Bugzilla %] +[% SET select_fields = {} %] +[% FOREACH field = Bugzilla.get_fields( + { type => constants.FIELD_TYPE_SINGLE_SELECT, custom => 0 }) +%] + [% select_fields.${field.name} = field %] +[% END %] +
@@ -235,18 +243,21 @@ function handleWantsAttachment(wants_attachment) { - [% sel = { description => 'Severity', name => 'bug_severity' } %] - [% INCLUDE select %] + [% INCLUDE bug/field.html.tmpl + bug = default, field = select_fields.bug_severity, editable = 1, + value = default.bug_severity %] - [% sel = { description => 'Platform', name => 'rep_platform' } %] - [% INCLUDE select %] + [% INCLUDE bug/field.html.tmpl + bug = default, field = select_fields.rep_platform, editable = 1, + value = default.rep_platform %] - [% sel = { description => 'OS', name => 'op_sys' } %] - [% INCLUDE select %] + [% INCLUDE bug/field.html.tmpl + bug = default, field = select_fields.op_sys, editable = 1, + value = default.op_sys %] @@ -260,12 +271,11 @@ function handleWantsAttachment(wants_attachment) { [% END %] [% IF Param('letsubmitterchoosepriority') %] - [% sel = { description => 'Priority', name => 'priority' } %] - [% INCLUDE select %] + [% INCLUDE bug/field.html.tmpl + bug = default, field = select_fields.priority, editable = 1, + value = default.priority %] [% ELSE %] - - - +   [% END %] @@ -437,7 +447,9 @@ function handleWantsAttachment(wants_attachment) { [% NEXT UNLESS field.enter_bug %] [% SET value = ${field.name}.defined ? ${field.name} : "" %] - [% 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 %] [% END %] @@ -617,7 +629,7 @@ function handleWantsAttachment(wants_attachment) { [% END %] - [%- FOREACH x = ${sel.name} %] [% END %] + + [% IF sel.name == "bug_status" %] + [% FOREACH controlled = select_fields.bug_status.controls_visibility_of %] + + [% END %] + [% END %] [% END %] -- cgit v1.2.3-24-g4f1b