From 3cea91884b28b52df4e38f2ba88c00b65071a81f Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Sat, 25 Oct 2008 04:11:30 +0000 Subject: Bug 291433: Ability to have custom fields whose visibility depends on the values of other fields Patch By Max Kanat-Alexander r=bbaetz, a=mkanat --- template/en/default/bug/field.html.tmpl | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'template/en/default/bug/field.html.tmpl') diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl index 762e659db..3b26073aa 100644 --- a/template/en/default/bug/field.html.tmpl +++ b/template/en/default/bug/field.html.tmpl @@ -28,9 +28,21 @@ # allow_dont_change: display the --do_not_change-- option for select fields. # value_span: A colspan for the table cell containing # the field value. + # bug (optional): The current Bugzilla::Bug being displayed, or a hash + # with default field values being displayed on a page. #%] - +[% SET hidden = 0 %] +[% IF field.visibility_field.defined %] + [% IF !bug.${field.visibility_field.name} + .contains(field.visibility_value.name) + %] + [% SET hidden = 1 %] + [% END %] +[% END %] + + [% IF editable %] ' IF editable %] - + [% IF editable %] [% SWITCH field.type %] [% CASE constants.FIELD_TYPE_FREETEXT %] @@ -121,6 +135,14 @@ id = field.name name = field.name minrows = 4 maxrows = 8 cols = 60 defaultcontent = value %] [% END %] + + [% FOREACH controlled_field = field.controls_visibility_of %] + + [% END %] [% ELSIF field.type == constants.FIELD_TYPE_TEXTAREA %]
[% value FILTER wrap_comment(60) FILTER html %]
-- cgit v1.2.3-24-g4f1b