summaryrefslogtreecommitdiffstats
path: root/template/en/default/bug
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2012-11-14 17:25:01 +0100
committerDave Lawrence <dlawrence@mozilla.com>2012-11-14 17:25:01 +0100
commite4e3c1b860c47976dc7314ec26d336caa59bebd0 (patch)
tree5161f7edb5d9b9046d7b98af3d000f37880f389b /template/en/default/bug
parent38fa3fab5ae996c6116b55fe87e60ea6b53b2923 (diff)
parent442d6df4683b7219738bb799a3650dd8b9c8431f (diff)
downloadbugzilla-e4e3c1b860c47976dc7314ec26d336caa59bebd0.tar.gz
bugzilla-e4e3c1b860c47976dc7314ec26d336caa59bebd0.tar.xz
merged with bugzilla/4.2
Diffstat (limited to 'template/en/default/bug')
-rw-r--r--template/en/default/bug/edit.html.tmpl12
-rw-r--r--template/en/default/bug/field-events.js.tmpl18
2 files changed, 21 insertions, 9 deletions
diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl
index 5fa8d5e6b..52e5865b8 100644
--- a/template/en/default/bug/edit.html.tmpl
+++ b/template/en/default/bug/edit.html.tmpl
@@ -30,9 +30,8 @@
[% PROCESS bug/time.html.tmpl %]
- <script type="text/javascript">
- <!--
-
+<script type="text/javascript">
+<!--
[% IF user.is_timetracker %]
var fRemainingTime = [% bug.remaining_time %]; // holds the original value
function adjustRemainingTime() {
@@ -53,6 +52,7 @@
}
[% END %]
+[% IF user.id %]
/* Index all classifications so we can keep track of the classification
* for the selected product, which could control field visibility.
*/
@@ -61,9 +61,9 @@
all_classifications['[% product.name FILTER js %]'] = '
[%- product.classification.name FILTER js %]';
[%- END %]
-
- //-->
- </script>
+[% END %]
+//-->
+</script>
<form name="changeform" id="changeform" method="post" action="process_bug.cgi">
diff --git a/template/en/default/bug/field-events.js.tmpl b/template/en/default/bug/field-events.js.tmpl
index 13ec18d38..f1d5afd32 100644
--- a/template/en/default/bug/field-events.js.tmpl
+++ b/template/en/default/bug/field-events.js.tmpl
@@ -24,11 +24,23 @@
#%]
[% FOREACH controlled_field = field.controls_visibility_of %]
+ [% vis_names = [] %]
+ [% FOREACH visibility_value = controlled_field.visibility_values %]
+ [%# Exclude non-enterable products and components outside the current product. %]
+ [% NEXT IF field.name == "product"
+ && visibility_value.id != product.id
+ && !user.can_enter_product(visibility_value) %]
+ [% NEXT IF field.name == "component" && visibility_value.product_id != product.id %]
+ [% vis_names.push(visibility_value.name) %]
+ [% END %]
+
+ [% NEXT UNLESS vis_names.size %]
+
showFieldWhen('[% controlled_field.name FILTER js %]',
'[% field.name FILTER js %]', [
- [%- FOREACH visibility_value = controlled_field.visibility_values -%]
- '[%- visibility_value.name FILTER js -%]'[% "," UNLESS loop.last %]
- [%- END %]
+ [%~ FOREACH vis_name = vis_names ~%]
+ '[% vis_name FILTER js %]'[% "," UNLESS loop.last %]
+ [%~ END ~%]
]);
[% END %]