From 246c04a3b156d5c9c2c4fedd9ba55c2037b66586 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Wed, 26 Aug 2015 23:29:51 +0200 Subject: Bug 1196969: Custom fields whose visibility depend on the product are not displayed/hidden correctly r=gerv a=sgreen --- template/en/default/bug/edit.html.tmpl | 20 ++++++-------------- template/en/default/bug/field.html.tmpl | 18 +++++++++++++----- 2 files changed, 19 insertions(+), 19 deletions(-) (limited to 'template') diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl index f21e840ba..7f2b741f6 100644 --- a/template/en/default/bug/edit.html.tmpl +++ b/template/en/default/bug/edit.html.tmpl @@ -230,20 +230,12 @@ [%# PRODUCT #%] [%#############%] - [% INCLUDE "bug/field-label.html.tmpl" - field = bug_fields.product - desc_url = 'describecomponents.cgi' - value = bug.product - %] - - [% INCLUDE "global/product-select.html.tmpl" - id => "product" - name => "product" - value => bug.product - products => bug.choices.product - isselect => bug.check_can_change_field('product', 0, 1) - %] - + [% INCLUDE bug/field.html.tmpl + bug = bug, field = bug_fields.product, value = bug.product + override_legal_values = bug.choices.product + desc_url = "describecomponents.cgi" + editable = bug.check_can_change_field('product', 0, 1) + %] [%# Classification is here so that it can be used in value controllers diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl index 85f7aea33..4d6019d01 100644 --- a/template/en/default/bug/field.html.tmpl +++ b/template/en/default/bug/field.html.tmpl @@ -91,6 +91,12 @@ [% CASE [ constants.FIELD_TYPE_SINGLE_SELECT constants.FIELD_TYPE_MULTI_SELECT ] %] + [%# The 'product' field needs its own template if classifications are enabled. %] + [% IF field.name == "product" AND Param('useclassification') %] + [% INCLUDE "global/product-select.html.tmpl" + id = "product", name = "product", value = value + products = override_legal_values %] + [% ELSE %]