From aa888f2218179d59b4f0b8e51e43b863f1da3e43 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Sat, 8 Sep 2007 05:14:25 +0000 Subject: Bug 287330: Multi-Select Custom Fields Patch By Max Kanat-Alexander r=LpSolit, a=LpSolit --- .../en/default/admin/custom_fields/edit.html.tmpl | 3 ++- template/en/default/bug/field.html.tmpl | 31 ++++++++++++++++++---- template/en/default/global/field-descs.none.tmpl | 4 ++- template/en/default/global/user-error.html.tmpl | 6 ++--- 4 files changed, 34 insertions(+), 10 deletions(-) (limited to 'template') diff --git a/template/en/default/admin/custom_fields/edit.html.tmpl b/template/en/default/admin/custom_fields/edit.html.tmpl index 9199eb62a..b983bbcc6 100644 --- a/template/en/default/admin/custom_fields/edit.html.tmpl +++ b/template/en/default/admin/custom_fields/edit.html.tmpl @@ -84,7 +84,8 @@     - [% IF field.type == constants.FIELD_TYPE_SINGLE_SELECT %] + [% IF field.type == constants.FIELD_TYPE_SINGLE_SELECT + || field.type == constants.FIELD_TYPE_MULTI_SELECT %]   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 %] - [% CASE constants.FIELD_TYPE_SINGLE_SELECT %] - [% IF allow_dont_change %] - [% END %] [% FOREACH legal_value = field.legal_values %] [% END %] + [%# 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 %] + + [% END %] [% END %] [% ELSE %] - [% value FILTER html %] + [% value.join(', ') FILTER html %] [% END %] diff --git a/template/en/default/global/field-descs.none.tmpl b/template/en/default/global/field-descs.none.tmpl index 2d577bb1a..dc6887707 100644 --- a/template/en/default/global/field-descs.none.tmpl +++ b/template/en/default/global/field-descs.none.tmpl @@ -80,7 +80,9 @@ [% field_types = { ${constants.FIELD_TYPE_UNKNOWN} => "Unknown Type", ${constants.FIELD_TYPE_FREETEXT} => "Free Text", - ${constants.FIELD_TYPE_SINGLE_SELECT} => "Drop Down" } %] + ${constants.FIELD_TYPE_SINGLE_SELECT} => "Drop Down", + ${constants.FIELD_TYPE_MULTI_SELECT} => "Multiple-Selection Box", + } %] [% status_descs = { "UNCONFIRMED" => "UNCONFIRMED", "NEW" => "NEW", diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 5a33b75c5..ff9c17497 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -658,13 +658,13 @@ [% ELSIF error == "illegal_change" %] [% title = "Not allowed" %] - You tried to change the + You tried to change the [% field_descs.$field FILTER html %] field [% IF oldvalue.defined %] - from [% oldvalue FILTER html %] + from [% oldvalue.join(', ') FILTER html %] [% END %] [% IF newvalue.defined %] - to [% newvalue FILTER html %] + to [% newvalue.join(', ') FILTER html %] [% END %] , but only [% IF privs < 3 %] -- cgit v1.2.3-24-g4f1b