summaryrefslogtreecommitdiffstats
path: root/template/en/default
diff options
context:
space:
mode:
authorTiago Mello <timello@gmail.com>2010-08-27 05:27:08 +0200
committerTiago Mello <timello@gmail.com>2010-08-27 05:27:08 +0200
commit0844fe9fc6d2d5293fad1384d2955dedf30fc8c4 (patch)
tree636a0bbcdf71017fda712e60cd1a0dc1b7038b7b /template/en/default
parentd94865b30a92be8a3a900f8d1d8262d36044b1ca (diff)
downloadbugzilla-0844fe9fc6d2d5293fad1384d2955dedf30fc8c4.tar.gz
bugzilla-0844fe9fc6d2d5293fad1384d2955dedf30fc8c4.tar.xz
Bug 479400: Add the ability to show or hide particular custom fields
based on multiple values of another field (visibility controllers) r/a=mkanat
Diffstat (limited to 'template/en/default')
-rw-r--r--template/en/default/admin/custom_fields/cf-js.js.tmpl2
-rw-r--r--template/en/default/admin/custom_fields/create.html.tmpl7
-rw-r--r--template/en/default/admin/custom_fields/edit.html.tmpl10
-rw-r--r--template/en/default/bug/field-events.js.tmpl7
-rw-r--r--template/en/default/bug/field.html.tmpl4
-rw-r--r--template/en/default/global/user-error.html.tmpl5
6 files changed, 23 insertions, 12 deletions
diff --git a/template/en/default/admin/custom_fields/cf-js.js.tmpl b/template/en/default/admin/custom_fields/cf-js.js.tmpl
index f9c31b5c7..cc1a4e4aa 100644
--- a/template/en/default/admin/custom_fields/cf-js.js.tmpl
+++ b/template/en/default/admin/custom_fields/cf-js.js.tmpl
@@ -65,7 +65,7 @@ function onChangeType(type_field) {
function onChangeVisibilityField() {
var vis_field = document.getElementById('visibility_field_id');
- var vis_value = document.getElementById('visibility_value_id');
+ var vis_value = document.getElementById('visibility_values');
if (vis_field.value) {
var values = select_values[vis_field.value];
diff --git a/template/en/default/admin/custom_fields/create.html.tmpl b/template/en/default/admin/custom_fields/create.html.tmpl
index b96738473..f89f979fd 100644
--- a/template/en/default/admin/custom_fields/create.html.tmpl
+++ b/template/en/default/admin/custom_fields/create.html.tmpl
@@ -130,8 +130,11 @@ YAHOO.util.Event.onDOMReady(function() {onChangeType(document.getElementById('ty
</option>
[% END %]
</select>
- <label for="visibility_value_id"><strong>is set to:</strong></label>
- <select name="visibility_value_id" id="visibility_value_id">
+ <label for="visibility_values">
+ <strong>is set to any of:</strong>
+ </label>
+ <select multiple="multiple" size="5" name="visibility_values"
+ id="visibility_values" class="field_value">
<option value=""></option>
</select>
</td>
diff --git a/template/en/default/admin/custom_fields/edit.html.tmpl b/template/en/default/admin/custom_fields/edit.html.tmpl
index 48c3396f3..5ce2b7fd5 100644
--- a/template/en/default/admin/custom_fields/edit.html.tmpl
+++ b/template/en/default/admin/custom_fields/edit.html.tmpl
@@ -118,12 +118,14 @@
</option>
[% END %]
</select>
- <label for="visibility_value_id"><strong>is set to:</strong></label>
- <select name="visibility_value_id" id="visibility_value_id">
+ <label for="visibility_values">
+ <strong>is set to any of:</strong>
+ </label>
+ <select multiple="multiple" size="5" name="visibility_values"
+ id="visibility_values" class="field_value">
[% FOREACH value = field.visibility_field.legal_values %]
<option value="[% value.id FILTER html %]"
- [% ' selected="selected"'
- IF field.visibility_value.id == value.id %]>
+ [% " selected" IF field.visibility_values.contains(value) %]>
[% IF field.visibility_field.name == 'component' %]
[% display_value('product', value.product.name) FILTER html %]:
[% END %]
diff --git a/template/en/default/bug/field-events.js.tmpl b/template/en/default/bug/field-events.js.tmpl
index f9e0ea93d..94dd298f5 100644
--- a/template/en/default/bug/field-events.js.tmpl
+++ b/template/en/default/bug/field-events.js.tmpl
@@ -23,8 +23,11 @@
[% FOREACH controlled_field = field.controls_visibility_of %]
showFieldWhen('[% controlled_field.name FILTER js %]',
- '[% field.name FILTER js %]',
- '[% controlled_field.visibility_value.name FILTER js %]');
+ '[% field.name FILTER js %]', [
+ [%- FOREACH visibility_value = controlled_field.visibility_values -%]
+ '[%- visibility_value.name FILTER js -%]'[% "," UNLESS loop.last %]
+ [%- END %]
+ ]);
[% END %]
[% FOREACH legal_value = field.legal_values %]
[% FOREACH controlled_field = legal_value.controlled_values.keys %]
diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl
index 49cf718cc..34347b21c 100644
--- a/template/en/default/bug/field.html.tmpl
+++ b/template/en/default/bug/field.html.tmpl
@@ -42,9 +42,7 @@
#%]
[% SET hidden = 0 %]
-[% IF field.visibility_field.defined AND bug
- AND !field.visibility_value.is_set_on_bug(bug)
-%]
+[% IF bug AND !field.is_visible_on_bug(bug) %]
[% SET hidden = 1 %]
[% END %]
diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl
index 59fa47bf9..f63092c96 100644
--- a/template/en/default/global/user-error.html.tmpl
+++ b/template/en/default/global/user-error.html.tmpl
@@ -482,6 +482,11 @@
Only Drop-Down or Multi-Select fields can have a field that
controls their values.
+ [% ELSIF error == "field_visibility_values_must_be_selected" %]
+ [% title = "Missing visibility field values" %]
+ At least one value must be selected for the visibility field
+ '[% field.name FILTER html %]'.
+
[% ELSIF error == "fieldname_invalid" %]
[% title = "Specified Field Does Not Exist" %]
The field '[% field.name FILTER html %]' does not exist or