summaryrefslogtreecommitdiffstats
path: root/template/en/default/bug/field-events.js.tmpl
diff options
context:
space:
mode:
Diffstat (limited to 'template/en/default/bug/field-events.js.tmpl')
-rw-r--r--template/en/default/bug/field-events.js.tmpl12
1 files changed, 11 insertions, 1 deletions
diff --git a/template/en/default/bug/field-events.js.tmpl b/template/en/default/bug/field-events.js.tmpl
index fa805b528..003391c34 100644
--- a/template/en/default/bug/field-events.js.tmpl
+++ b/template/en/default/bug/field-events.js.tmpl
@@ -8,6 +8,8 @@
[%# INTERFACE:
# field: a Bugzilla::Field object
+ # product: (optional) a Bugzilla::Product object. When specified,
+ # components are restricted to this product.
#%]
[% FOREACH controlled_field = field.controls_visibility_of %]
@@ -18,7 +20,15 @@
[%- END %]
]);
[% END %]
-[% FOREACH legal_value = field.legal_values %]
+
+[% legal_values = [] %]
+[% IF field.name == "component" AND product %]
+ [% legal_values = product.components %]
+[% ELSE %]
+ [% legal_values = field.legal_values %]
+[% END %]
+
+[% FOREACH legal_value = legal_values %]
[% FOREACH controlled_field = legal_value.controlled_values.keys %]
[% SET cont_ids = [] %]
[% FOREACH val = legal_value.controlled_values.$controlled_field %]