From a43231dd4ccef2b02fa0434217b637a6d1638c97 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Fri, 3 Oct 2008 06:40:15 +0000 Subject: Bug 456922: Now that Bugzilla::Field::Choice is complete, clean up editvalues.cgi and error messages Patch By Max Kanat-Alexander r=bbaetz, a=mkanat --- .../admin/fieldvalues/confirm-delete.html.tmpl | 83 ++++++++++++---------- .../en/default/admin/fieldvalues/create.html.tmpl | 13 ++-- .../en/default/admin/fieldvalues/edit.html.tmpl | 32 ++++----- .../en/default/admin/fieldvalues/footer.html.tmpl | 9 +-- .../en/default/admin/fieldvalues/list.html.tmpl | 31 ++++---- template/en/default/global/messages.html.tmpl | 16 ++--- template/en/default/global/user-error.html.tmpl | 27 ++----- 7 files changed, 102 insertions(+), 109 deletions(-) (limited to 'template') diff --git a/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl b/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl index d18e03a53..12be0e8e4 100644 --- a/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl +++ b/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl @@ -14,18 +14,14 @@ #%] [%# INTERFACE: - # value: string; The field value being deleted. - # bug_count: number; The number of bugs that have this field value. - # value_count: number; The number of values left for this field, including - # this value. + # value: Bugzilla::Field::Choice; The field value being deleted. + # value_count: number; The number of values available for this field. # field: object; the field the value is being deleted from. - # param_name: string; The name of the parameter (defaultxxx) associated - # with the field. #%] [% title = BLOCK %] - Delete Value '[% value FILTER html %]' from the '[% field.description FILTER html %]' - ([% field.name FILTER html %]) field + Delete Value '[% value.name FILTER html %]' from the + '[% field.description FILTER html %]' ([% field.name FILTER html %]) field [% END %] [% PROCESS global/header.html.tmpl @@ -44,15 +40,18 @@ Field Value: - [% value FILTER html %] + [% value.name FILTER html %] [% terms.Bugs %]: -[% IF bug_count %] - [% bug_count FILTER html %] +[% IF value.bug_count %] + + [%- value.bug_count FILTER html %] [% ELSE %] None [% END %] @@ -62,44 +61,52 @@

Confirmation

-[% IF (param_name.defined && Param(param_name) == value) || bug_count || (value_count == 1) %] +[% IF value.is_default || value.bug_count || (value_count == 1) %] -

Sorry, but the '[% value FILTER html %]' value cannot be deleted - from the '[% field.description FILTER html %]' field for the following reason(s):

+

Sorry, but the '[% value.name FILTER html %]' value cannot be deleted + from the '[% field.description FILTER html %]' field for the following + reason(s):

@@ -111,7 +118,7 @@ - + diff --git a/template/en/default/admin/fieldvalues/create.html.tmpl b/template/en/default/admin/fieldvalues/create.html.tmpl index fe906bfe3..9d318cd1d 100644 --- a/template/en/default/admin/fieldvalues/create.html.tmpl +++ b/template/en/default/admin/fieldvalues/create.html.tmpl @@ -26,26 +26,27 @@ %]

- This page allows you to add a new value for the '[% field.description FILTER html %]' field. + This page allows you to add a new value for the + '[% field.description FILTER html %]' field.

- + - + [% IF field.name == "bug_status" %]
- +
diff --git a/template/en/default/admin/fieldvalues/edit.html.tmpl b/template/en/default/admin/fieldvalues/edit.html.tmpl index 98b480ba8..29f881ec8 100644 --- a/template/en/default/admin/fieldvalues/edit.html.tmpl +++ b/template/en/default/admin/fieldvalues/edit.html.tmpl @@ -14,16 +14,15 @@ #%] [%# INTERFACE: - # value: string; The field value we are editing. - # sortkey: number; Sortkey of the field value we are editing. - # field: object; The field this value belongs to. + # value: Bugzilla::Field::Choice; The field value we are editing. + # field: Bugzilla::Field; The field this value belongs to. #%] [% PROCESS global/variables.none.tmpl %] [% title = BLOCK %] - Edit Value '[% value FILTER html %]' for the '[% field.description FILTER html %]' - ([% field.name FILTER html %]) field + Edit Value '[% value.name FILTER html %]' for the + '[% field.description FILTER html %]' ([% field.name FILTER html %]) field [% END %] [% PROCESS global/header.html.tmpl title = title @@ -33,32 +32,33 @@ - + - + [% IF field.name == "bug_status" %] - + [% END %]
- [% IF is_static %] - - [% value FILTER html %] + [% IF value.is_static %] + + [%- value.name FILTER html %] [% ELSE %] - + [% END %]
[% IF is_open %]Open[% ELSE %]Closed[% END %][% IF value.is_open %]Open[% ELSE %]Closed[% END %]
- - + diff --git a/template/en/default/admin/fieldvalues/footer.html.tmpl b/template/en/default/admin/fieldvalues/footer.html.tmpl index dcb6dbc8d..288612d4c 100644 --- a/template/en/default/admin/fieldvalues/footer.html.tmpl +++ b/template/en/default/admin/fieldvalues/footer.html.tmpl @@ -35,13 +35,14 @@ [%- field.name FILTER url_quote %]">Add a value. [% END %] -[% IF value && !no_edit_link %] +[% IF value.defined && !no_edit_link %] Edit value - '[% value FILTER html %]'. + [%- field.name FILTER url_quote %]&value= + [%- value.name FILTER url_quote %]"> + '[% value.name FILTER html %]'. [% END %] [% UNLESS no_edit_other_link %] diff --git a/template/en/default/admin/fieldvalues/list.html.tmpl b/template/en/default/admin/fieldvalues/list.html.tmpl index d14bbc26d..976b58ae7 100644 --- a/template/en/default/admin/fieldvalues/list.html.tmpl +++ b/template/en/default/admin/fieldvalues/list.html.tmpl @@ -58,26 +58,13 @@ } ] %] -[% IF default.defined %] - [% overrides.action = [ { - match_value => "$default" - match_field => 'name' - override_content => 1 - content => "(Default value)" - override_contentlink => 1 - contentlink => undef - } ] - %] -[% END %] -[% IF static.size %] - [% UNLESS overrides.action.size %] - [% overrides.action = [] %] - [% END %] +[% SET overrides.action = [] %] +[% FOREACH check_value = values %] - [% FOREACH static_value = static %] + [% IF check_value.is_static %] [% overrides.action.push({ - match_value => "$static_value" + match_value => check_value.name match_field => 'name' override_content => 1 content => "(Non-deletable value)" @@ -85,7 +72,17 @@ contentlink => undef }) %] + [% ELSIF check_value.is_default %] + [% overrides.action.push({ + match_value => check_value.name + match_field => 'name' + override_content => 1 + content => "(Default value)" + override_contentlink => 1 + contentlink => undef }) + %] [% END %] + [% END %] [% PROCESS admin/table.html.tmpl diff --git a/template/en/default/global/messages.html.tmpl b/template/en/default/global/messages.html.tmpl index 82a71a5a2..d7de4fbc7 100644 --- a/template/en/default/global/messages.html.tmpl +++ b/template/en/default/global/messages.html.tmpl @@ -298,31 +298,31 @@ [% ELSIF message_tag == "field_value_created" %] [% title = "New Field Value Created" %] - The value [% value FILTER html %] has been added as a valid choice - for the [% field.description FILTER html %] + The value [% value.name FILTER html %] has been added as a + valid choice for the [% field.description FILTER html %] ([% field.name FILTER html %]) field. [% IF field.name == "bug_status" %] - You should now visit the status workflow page - to include your new [% terms.bug %] status. + You should now visit the status workflow + page to include your new [% terms.bug %] status. [% END %] [% ELSIF message_tag == "field_value_deleted" %] [% title = "Field Value Deleted" %] - The value [% value FILTER html %] of the + The value [% value.name FILTER html %] of the [% field.description FILTER html %] ([% field.name FILTER html %]) field has been deleted. [% ELSIF message_tag == "field_value_updated" %] [% title = "Field Value Updated" %] [% IF changes.keys.size %] - The [% value FILTER html %] value of the + The [% value_old FILTER html %] value of the [% field.description FILTER html %] ([% field.name FILTER html %]) field has been changed:
    [% IF changes.value %]
  • Field value updated to [% changes.value.1 FILTER html %]. - [% IF value_obj.is_default %] + [% IF value.is_default %] (Note that this value is the default for this field. All references to the default value will now point to this new value.) [% END %] @@ -334,7 +334,7 @@ [% END %]
[% ELSE %] - No changes made to the field value [% value FILTER html %]. + No changes made to the field value [% value_old FILTER html %]. [% END %] [% ELSIF message_tag == "flag_cleared" %] diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index c1fc9ae0d..c7b83e334 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -422,26 +422,17 @@ [% ELSIF error == "fieldname_invalid" %] [% title = "Specified Field Does Not Exist" %] - The field '[% field FILTER html %]' does not exist or + The field '[% field.name FILTER html %]' does not exist or cannot be edited with this interface. - [% ELSIF error == "fieldname_not_specified" %] - [% title = "Field Name Not Specified" %] - No field name specified when trying to edit field values. - [% ELSIF error == "fieldvalue_already_exists" %] [% title = "Field Value Already Exists" %] - The value '[% value FILTER html %]' already exists for the + The value '[% value.name FILTER html %]' already exists for the [%+ field.description FILTER html %] field. - [% ELSIF error == "fieldvalue_doesnt_exist" %] - [% title = "Specified Field Value Does Not Exist" %] - The value '[% value FILTER html %]' does not exist for - the '[% field FILTER html %]' field. - [% ELSIF error == "fieldvalue_is_default" %] [% title = "Specified Field Value Is Default" %] - '[% value FILTER html %]' is the default value for + '[% value.name FILTER html %]' is the default value for the '[% field.description FILTER html %]' field and cannot be deleted. [% IF user.in_group('tweakparams') %] You have to