summaryrefslogtreecommitdiffstats
path: root/template
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2006-09-09 08:11:40 +0200
committerlpsolit%gmail.com <>2006-09-09 08:11:40 +0200
commita806b298f5bfe5914f27a1419d27366fe59da449 (patch)
tree25d737aeb60f17360de9a67f2017369a4d5d8349 /template
parent27c1be36a3cbc57e01c8d51af85be76b0748ece6 (diff)
downloadbugzilla-a806b298f5bfe5914f27a1419d27366fe59da449.tar.gz
bugzilla-a806b298f5bfe5914f27a1419d27366fe59da449.tar.xz
Bug 287326: Ability to add custom single-select fields to a bug - Patch by Frédéric Buclin <LpSolit@gmail.com> and Max Kanat-Alexander <mkanat@bugzilla.org> r=mkanat a=myk
Diffstat (limited to 'template')
-rw-r--r--template/en/default/admin/custom_fields/create.html.tmpl7
-rw-r--r--template/en/default/admin/custom_fields/edit.html.tmpl11
-rw-r--r--template/en/default/admin/custom_fields/list.html.tmpl12
-rw-r--r--template/en/default/bug/field.html.tmpl8
-rw-r--r--template/en/default/global/code-error.html.tmpl4
-rw-r--r--template/en/default/global/field-descs.none.tmpl4
-rw-r--r--template/en/default/global/user-error.html.tmpl5
7 files changed, 47 insertions, 4 deletions
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 @@
<tr>
<th align="right"><label for="type">Type:</label></th>
<td>
- [%# Only one field type is valid right now. But let's prepare the UI
- # for future new types. %]
<select id="type" name="type">
- <option value="FIELD_TYPE_FREETEXT">Free Text</option>
+ [% FOREACH type = field_types.keys %]
+ [% NEXT IF type == constants.FIELD_TYPE_UNKNOWN %]
+ <option value="[% type FILTER html %]">[% field_types.$type FILTER html %]</option>
+ [% END %]
</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 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 @@
</tr>
<tr>
<th align="right">Type:</th>
- <td>Free Text</td>
+ <td>[% field_types.${field.type} FILTER html %]</td>
<th align="right"><label for="obsolete">Is obsolete:</label></th>
<td><input type="checkbox" id="obsolete" name="obsolete" value="1"
@@ -85,6 +85,15 @@
<th>&nbsp;</th>
<td>&nbsp;</td>
</tr>
+ [% IF field.type == constants.FIELD_TYPE_SINGLE_SELECT %]
+ <tr>
+ <th>&nbsp;</th>
+ <td colspan="3">
+ <a href="editvalues.cgi?field=[% field.name FILTER url_quote %]">Edit
+ legal values for this field</a>.
+ </td>
+ </tr>
+ [% END %]
</table>
<br>
<input type="hidden" name="action" value="update">
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
@@ -37,6 +37,10 @@
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 %]
<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 %]">
+ [% FOREACH legal_value = field.legal_values %]
+ <option value="[% legal_value FILTER html %]"
+ [%- " selected=\"selected\"" IF value == legal_value %]>
+ [%- legal_value FILTER html %]</option>
+ [% END %]
+ </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 <em>[% fragment FILTER html %]</em>.
+ [% ELSIF error == "invalid_customfield_type" %]
+ [% title = "Invalid Field Type" %]
+ The type <em>[% type FILTER html %]</em> 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 %]'.