From a806b298f5bfe5914f27a1419d27366fe59da449 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Sat, 9 Sep 2006 06:11:40 +0000 Subject: Bug 287326: Ability to add custom single-select fields to a bug - Patch by Frédéric Buclin and Max Kanat-Alexander r=mkanat a=myk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/en/default/admin/custom_fields/create.html.tmpl | 7 ++++--- template/en/default/admin/custom_fields/edit.html.tmpl | 11 ++++++++++- template/en/default/admin/custom_fields/list.html.tmpl | 12 ++++++++++++ template/en/default/bug/field.html.tmpl | 8 ++++++++ template/en/default/global/code-error.html.tmpl | 4 ++++ template/en/default/global/field-descs.none.tmpl | 4 ++++ template/en/default/global/user-error.html.tmpl | 5 +++++ 7 files changed, 47 insertions(+), 4 deletions(-) (limited to 'template') diff --git a/template/en/default/admin/custom_fields/create.html.tmpl b/template/en/default/admin/custom_fields/create.html.tmpl index b366371bd..e8b66deca 100644 --- a/template/en/default/admin/custom_fields/create.html.tmpl +++ b/template/en/default/admin/custom_fields/create.html.tmpl @@ -79,10 +79,11 @@ - [%# Only one field type is valid right now. But let's prepare the UI - # for future new types. %] diff --git a/template/en/default/admin/custom_fields/edit.html.tmpl b/template/en/default/admin/custom_fields/edit.html.tmpl index def825e7c..6ffa3d89d 100644 --- a/template/en/default/admin/custom_fields/edit.html.tmpl +++ b/template/en/default/admin/custom_fields/edit.html.tmpl @@ -69,7 +69,7 @@ Type: - Free Text + [% field_types.${field.type} FILTER html %]     + [% IF field.type == constants.FIELD_TYPE_SINGLE_SELECT %] + +   + + Edit + legal values for this field. + + + [% END %]
diff --git a/template/en/default/admin/custom_fields/list.html.tmpl b/template/en/default/admin/custom_fields/list.html.tmpl index e02609dd3..2f64b0f06 100644 --- a/template/en/default/admin/custom_fields/list.html.tmpl +++ b/template/en/default/admin/custom_fields/list.html.tmpl @@ -36,6 +36,10 @@ name => "sortkey" heading => "Sortkey" }, + { + name => "type_name" + heading => "Type" + }, { name => "enter_bug" heading => "Editable on Bug Creation" @@ -51,6 +55,14 @@ ] %] +[% USE Bugzilla %] +[% custom_fields = Bugzilla.get_fields({ custom => 1 }) %] + +[%# We want to display the type name of fields, not their type ID. %] +[% FOREACH cf_field = custom_fields %] + [% cf_field.type_name = field_types.${cf_field.type} %] +[% END %] + [% PROCESS admin/table.html.tmpl columns = columns data = custom_fields diff --git a/template/en/default/bug/field.html.tmpl b/template/en/default/bug/field.html.tmpl index 59020518b..008674d60 100644 --- a/template/en/default/bug/field.html.tmpl +++ b/template/en/default/bug/field.html.tmpl @@ -42,6 +42,14 @@ [% SWITCH field.type %] [% CASE constants.FIELD_TYPE_FREETEXT %] + [% CASE constants.FIELD_TYPE_SINGLE_SELECT %] + [% END %] [% ELSE %] [% value FILTER html %] diff --git a/template/en/default/global/code-error.html.tmpl b/template/en/default/global/code-error.html.tmpl index 9c504b827..b0d7fcda8 100644 --- a/template/en/default/global/code-error.html.tmpl +++ b/template/en/default/global/code-error.html.tmpl @@ -170,6 +170,10 @@ The custom sort order specified in your form submission contains an invalid column name [% fragment FILTER html %]. + [% ELSIF error == "invalid_customfield_type" %] + [% title = "Invalid Field Type" %] + The type [% type FILTER html %] is not a valid field type. + [% ELSIF error == "invalid_dimensions" %] [% title = "Invalid Dimensions" %] The width or height specified is not a positive integer. diff --git a/template/en/default/global/field-descs.none.tmpl b/template/en/default/global/field-descs.none.tmpl index 254bfef1d..94ba948d6 100644 --- a/template/en/default/global/field-descs.none.tmpl +++ b/template/en/default/global/field-descs.none.tmpl @@ -80,6 +80,10 @@ IF !field_descs.${bz_field.name}.defined %] [% END %] +[% field_types = { ${constants.FIELD_TYPE_UNKNOWN} => "Unknown Type", + ${constants.FIELD_TYPE_FREETEXT} => "Free Text", + ${constants.FIELD_TYPE_SINGLE_SELECT} => "Drop Down" } %] + [% status_descs = { "UNCONFIRMED" => "UNCONFIRMED", "NEW" => "NEW", "ASSIGNED" => "ASSIGNED", diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 9a0d04555..a9706376b 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -314,6 +314,11 @@ The field '[% field.name FILTER html %]' ([% field.description FILTER html %]) already exists. Please choose another name. + [% ELSIF error == "customfield_invalid_name" %] + [% title = "Invalid Custom Field Name" %] + '[% name FILTER html %]' is not a valid name for a custom field. + A name may contain only letters, numbers, and the underscore character. + [% ELSIF error == "customfield_nonexistent" %] [% title = "Unknown Custom Field" %] There is no custom field with the name '[% name FILTER html %]'. -- cgit v1.2.3-24-g4f1b