diff options
author | mkanat%bugzilla.org <> | 2007-09-08 07:14:25 +0200 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2007-09-08 07:14:25 +0200 |
commit | aa888f2218179d59b4f0b8e51e43b863f1da3e43 (patch) | |
tree | 4e6bf6ff4b7066b19c5b1728dd325adf4bed1f78 /template/en/default/bug | |
parent | 16336299f17522d040736cb0f063694381d9d761 (diff) | |
download | bugzilla-aa888f2218179d59b4f0b8e51e43b863f1da3e43.tar.gz bugzilla-aa888f2218179d59b4f0b8e51e43b863f1da3e43.tar.xz |
Bug 287330: Multi-Select Custom Fields
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=LpSolit
Diffstat (limited to 'template/en/default/bug')
-rw-r--r-- | template/en/default/bug/field.html.tmpl | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl index af1233097..1652ffb0b 100644 --- a/template/en/default/bug/field.html.tmpl +++ b/template/en/default/bug/field.html.tmpl @@ -42,21 +42,42 @@ [% SWITCH field.type %] [% CASE constants.FIELD_TYPE_FREETEXT %] <input name="[% field.name FILTER html %]" value="[% value FILTER html %]" size="60"> - [% CASE constants.FIELD_TYPE_SINGLE_SELECT %] - <select id="[% field.name FILTER html %]" name="[% field.name FILTER html %]"> + [% CASE [ constants.FIELD_TYPE_SINGLE_SELECT + constants.FIELD_TYPE_MULTI_SELECT ] %] + <select id="[% field.name FILTER html %]" + name="[% field.name FILTER html %]" + [% IF field.type == constants.FIELD_TYPE_MULTI_SELECT %] + [% SET field_size = 5 %] + [% IF field.legal_values.size < 5 %] + [% SET field_size = field.legal_values.size %] + [% END %] + size="[% field_size FILTER html %]" multiple="multiple" + [% END %] + > [% IF allow_dont_change %] - <option value="[% dontchange FILTER html %]"> + <option value="[% dontchange FILTER html %]" + [% ' selected="selected"' IF value == dontchange %]> [% dontchange FILTER html %] </option> [% END %] [% FOREACH legal_value = field.legal_values %] <option value="[% legal_value FILTER html %]" - [%- " selected=\"selected\"" IF value == legal_value %]> + [%- " selected=\"selected\"" IF value.contains(legal_value).size %]> [%- legal_value FILTER html %]</option> [% END %] </select> + [%# When you pass an empty multi-select in the web interface, + # it doesn't appear at all in the CGI object. Instead of + # forcing all users of process_bug to always specify every + # multi-select, we have this field defined if the multi-select + # field is defined, and then if this is passed but the multi-select + # isn't, we know that the multi-select was emptied. + %] + [% IF field.type == constants.FIELD_TYPE_MULTI_SELECT %] + <input type="hidden" name="defined_[% field.name FILTER html %]"> + [% END %] [% END %] [% ELSE %] - [% value FILTER html %] + [% value.join(', ') FILTER html %] [% END %] </td> |