From b8a8680e9d5ed7de541ab9f4e0275fa79a9a6d30 Mon Sep 17 00:00:00 2001 From: "mkanat%kerio.com" <> Date: Fri, 25 Feb 2005 06:48:05 +0000 Subject: Bug 281876: New Admin Interface to manage old Enum fields (Field Values) Patch By Max Kanat-Alexander r=joel, a=justdave --- .../admin/fieldvalues/confirm-delete.html.tmpl | 108 +++++++++++++++++++++ .../en/default/admin/fieldvalues/create.html.tmpl | 54 +++++++++++ .../en/default/admin/fieldvalues/created.html.tmpl | 39 ++++++++ .../en/default/admin/fieldvalues/deleted.html.tmpl | 38 ++++++++ .../en/default/admin/fieldvalues/edit.html.tmpl | 60 ++++++++++++ .../en/default/admin/fieldvalues/footer.html.tmpl | 56 +++++++++++ .../en/default/admin/fieldvalues/list.html.tmpl | 73 ++++++++++++++ .../admin/fieldvalues/select-field.html.tmpl | 50 ++++++++++ .../en/default/admin/fieldvalues/updated.html.tmpl | 51 ++++++++++ template/en/default/admin/table.html.tmpl | 15 ++- template/en/default/global/useful-links.html.tmpl | 14 +-- template/en/default/global/user-error.html.tmpl | 43 ++++++++ 12 files changed, 590 insertions(+), 11 deletions(-) create mode 100644 template/en/default/admin/fieldvalues/confirm-delete.html.tmpl create mode 100644 template/en/default/admin/fieldvalues/create.html.tmpl create mode 100644 template/en/default/admin/fieldvalues/created.html.tmpl create mode 100644 template/en/default/admin/fieldvalues/deleted.html.tmpl create mode 100644 template/en/default/admin/fieldvalues/edit.html.tmpl create mode 100644 template/en/default/admin/fieldvalues/footer.html.tmpl create mode 100644 template/en/default/admin/fieldvalues/list.html.tmpl create mode 100644 template/en/default/admin/fieldvalues/select-field.html.tmpl create mode 100644 template/en/default/admin/fieldvalues/updated.html.tmpl (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 new file mode 100644 index 000000000..234a895a7 --- /dev/null +++ b/template/en/default/admin/fieldvalues/confirm-delete.html.tmpl @@ -0,0 +1,108 @@ +[%# 1.0@bugzilla.org %] +[%# The contents of this file are subject to the Mozilla Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/MPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is the Bugzilla Bug Tracking System. + # + # Contributor(s): Max Kanat-Alexander + #%] + +[%# 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. + # field: string; The name of the field. + #%] + +[% title = BLOCK %]Delete Value '[% value FILTER html %]' from the + '[% field FILTER html %]' field[% END %] + +[% PROCESS global/header.html.tmpl + title = title +%] + + + + + + + + + + + + + + + + + + +
FieldValue
Field Name:[% field FILTER html %]
Field Value:[% value FILTER html %]
[% terms.Bugs %]: +[% IF bug_count %] + [% bug_count FILTER html %] +[% ELSE %] + None +[% END %] +
+ +

Confirmation

+ +[% IF bug_count %] + + Sorry, there + + [% IF bug_count > 1 %] + are [% bug_count FILTER html %] [%+ terms.bugs %] + [% ELSE %] + is [% bug_count FILTER html %] [%+ terms.bug %] + [% END %] + + that still have this field value. You must change the field value on + + [% IF bug_count > 1 %] + those [% terms.bugs %] + [% ELSE %] + that [% terms.bug %] + [% END %] + + to another value before you can delete this value. + +[% END %] + +[% IF value_count == 1 %] + +

Sorry, but '[% value FILTER html %]' is the last value for + '[%- field FILTER html %]', and so it can not be deleted.

+ + [% ELSE %] + + [% IF bug_count == 0 %] + +

Do you really want to delete this value?

+ +

+ + + + +
+ + [% END %] + +[% END %] + +[% PROCESS admin/fieldvalues/footer.html.tmpl %] + +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/fieldvalues/create.html.tmpl b/template/en/default/admin/fieldvalues/create.html.tmpl new file mode 100644 index 000000000..70dbc4eb7 --- /dev/null +++ b/template/en/default/admin/fieldvalues/create.html.tmpl @@ -0,0 +1,54 @@ +[%# 1.0@bugzilla.org %] +[%# The contents of this file are subject to the Mozilla Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/MPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is the Bugzilla Bug Tracking System. + # + # Contributor(s): Max Kanat-Alexander + #%] + +[%# INTERFACE: + # field: string; name of the field the value is being created for + #%] + +[% title = BLOCK %]Add Value for the '[% field FILTER html %]' field[% END %] +[% h2 = BLOCK %]This page allows you to add a new value for the + '[% field FILTER html %]' field.[% END %] +[% PROCESS global/header.html.tmpl + title = title + h2 = h2 +%] + +
+ + + + + + + + + +
+ + + + +
+ +

+ +[% PROCESS admin/fieldvalues/footer.html.tmpl + no_add_link = 1 + %] + +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/fieldvalues/created.html.tmpl b/template/en/default/admin/fieldvalues/created.html.tmpl new file mode 100644 index 000000000..28688d991 --- /dev/null +++ b/template/en/default/admin/fieldvalues/created.html.tmpl @@ -0,0 +1,39 @@ +[%# 1.0@bugzilla.org %] +[%# The contents of this file are subject to the Mozilla Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/MPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is the Bugzilla Bug Tracking System. + # + # Contributor(s): Max Kanat-Alexander + #%] + +[%# INTERFACE: + # value: string; the name of the newly created field value + # field: string; the name of the field the value belongs to + #%] + +[% title = BLOCK %]New Value '[% product FILTER html %]' added to + '[% field FILTER html %]' field[% END %] +[% PROCESS global/header.html.tmpl + title = title +%] + +

The value ' + [%- value FILTER html %]' has been added as a valid choice for + the '[% field FILTER html %]' field.

+ +

+ +[% PROCESS admin/fieldvalues/footer.html.tmpl %] + +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/fieldvalues/deleted.html.tmpl b/template/en/default/admin/fieldvalues/deleted.html.tmpl new file mode 100644 index 000000000..2bb3c840b --- /dev/null +++ b/template/en/default/admin/fieldvalues/deleted.html.tmpl @@ -0,0 +1,38 @@ +[%# 1.0@bugzilla.org %] +[%# The contents of this file are subject to the Mozilla Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/MPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is the Bugzilla Bug Tracking System. + # + # Contributor(s): Max Kanat-Alexander + #%] + +[%# INTERFACE: + # value: string; the field value that was deleted. + # + # field: string; the field the value was deleted from. + # + #%] + +[% title = BLOCK %]Deleted Value '[% value FILTER html %]' for the + '[% field FILTER html %]' Field[% END %] +[% PROCESS global/header.html.tmpl + title = title +%] + +

Field Value '[% value FILTER html %]' deleted.

+ +

+ +[% PROCESS admin/fieldvalues/footer.html.tmpl + no_edit_link = 1 + %] + +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/fieldvalues/edit.html.tmpl b/template/en/default/admin/fieldvalues/edit.html.tmpl new file mode 100644 index 000000000..9771148cc --- /dev/null +++ b/template/en/default/admin/fieldvalues/edit.html.tmpl @@ -0,0 +1,60 @@ +[%# 1.0@bugzilla.org %] +[%# The contents of this file are subject to the Mozilla Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/MPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is the Bugzilla Bug Tracking System. + # + # Contributor(s): Max Kanat-Alexander + #%] + +[%# INTERFACE: + # value: string; The field value we are editing. + # sortkey: number; Sortkey of the field value we are editing. + # field: string; The field this value belongs to. + #%] + +[% PROCESS global/variables.none.tmpl %] + +[% title = BLOCK %]Edit Value '[% value FILTER html %]' ' + [%- filter FILTER html %]'[% END %] +[% PROCESS global/header.html.tmpl + title = title +%] + +

+ + + + + + + + + + + +
+ + + + + + + +
+ +

+ +[% PROCESS admin/fieldvalues/footer.html.tmpl + no_edit_link = 1 %] + +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/fieldvalues/footer.html.tmpl b/template/en/default/admin/fieldvalues/footer.html.tmpl new file mode 100644 index 000000000..05e8c757b --- /dev/null +++ b/template/en/default/admin/fieldvalues/footer.html.tmpl @@ -0,0 +1,56 @@ +[%# 1.0@bugzilla.org %] +[%# The contents of this file are subject to the Mozilla Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/MPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is the Bugzilla Bug Tracking System. + # + # Contributor(s): Max Kanat-Alexander + #%] + +[%# INTERFACE: + # value: string; the value being inserted/edited. + # field: string; the name of the field which the value + # belongs/belonged to + # + # no_XXX_link: boolean; if defined, then don't show the corresponding + # link. Supported parameters are: + # + # no_edit_link + # no_edit_other_link + # no_add_link + #%] + +

+ +


+ +[% UNLESS no_add_link %] + Add a value. +[% END %] + +[% IF value && !no_edit_milestone_link %] + Edit value + '[% value FILTER html %]'. +[% END %] + +[% UNLESS no_edit_other_link %] + Edit other values for the '[% field FILTER html %]' field. + +[% END %] + +

diff --git a/template/en/default/admin/fieldvalues/list.html.tmpl b/template/en/default/admin/fieldvalues/list.html.tmpl new file mode 100644 index 000000000..4f686d338 --- /dev/null +++ b/template/en/default/admin/fieldvalues/list.html.tmpl @@ -0,0 +1,73 @@ +[%# 1.0@bugzilla.org %] +[%# The contents of this file are subject to the Mozilla Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/MPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is the Bugzilla Bug Tracking System. + # + # Contributor(s): Max Kanat-Alexander + #%] + +[%# INTERFACE: + # values: array of hashes having the following properties: + # - name: string; The value. + # - sortkey: number; The sortkey used to order the value when + # displayed to the user in a list. + # + # field: string; the name of the field we are editing values for. + #%] + +[% USE Bugzilla %] +[% cgi = Bugzilla.cgi %] + +[% PROCESS global/variables.none.tmpl %] + +[% title = BLOCK %]Select value for the + '[% field FILTER html %]' field[% END %] +[% PROCESS global/header.html.tmpl + title = title +%] + +[% edit_contentlink = BLOCK %]editvalues.cgi?action=edit&field= + [%- field FILTER url_quote %]&value=%%name%%[% END %] +[% delete_contentlink = BLOCK %]editvalues.cgi?action=del&field= + [%- field FILTER url_quote %]&value=%%name%%[% END %] + + +[% columns = [ + { + name => "name" + heading => "Edit field value..." + contentlink => edit_contentlink + }, + { + name => "sortkey" + heading => "Sortkey" + }, + ] +%] + +[% columns.push({ + heading => "Action" + content => "Delete" + contentlink => delete_contentlink + }) %] + +[% PROCESS admin/table.html.tmpl + columns = columns + data = values +%] + +

+ +[% PROCESS admin/fieldvalues/footer.html.tmpl + no_edit_other_link = 1 + %] + +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/fieldvalues/select-field.html.tmpl b/template/en/default/admin/fieldvalues/select-field.html.tmpl new file mode 100644 index 000000000..834295225 --- /dev/null +++ b/template/en/default/admin/fieldvalues/select-field.html.tmpl @@ -0,0 +1,50 @@ +[%# 1.0@bugzilla.org %] +[%# The contents of this file are subject to the Mozilla Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/MPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is the Bugzilla Bug Tracking System. + # + # Contributor(s): Max Kanat-Alexander + # + #%] + +[%# INTERFACE: + # fields: Array of hashes. Each hash contains only one key, "name." + # The names are the same as the keys from field_descs + # (see global/field-descs.html.tmpl). + #%] + +[% USE Bugzilla %] +[% cgi = Bugzilla.cgi %] + +[% PROCESS global/variables.none.tmpl %] + +[% PROCESS global/header.html.tmpl + title = "Edit values for which field?" +%] + +[% columns = [ + { + name => "name" + heading => "Edit field values for..." + content_use_field = 1 + contentlink => "editvalues.cgi?field=%%name%%" + } + ] +%] + +[% PROCESS admin/table.html.tmpl + columns = columns + data = fields +%] + +

+ +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/fieldvalues/updated.html.tmpl b/template/en/default/admin/fieldvalues/updated.html.tmpl new file mode 100644 index 000000000..c19aac285 --- /dev/null +++ b/template/en/default/admin/fieldvalues/updated.html.tmpl @@ -0,0 +1,51 @@ +[%# 1.0@bugzilla.org %] +[%# The contents of this file are subject to the Mozilla Public + # License Version 1.1 (the "License"); you may not use this file + # except in compliance with the License. You may obtain a copy of + # the License at http://www.mozilla.org/MPL/ + # + # Software distributed under the License is distributed on an "AS + # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or + # implied. See the License for the specific language governing + # rights and limitations under the License. + # + # The Original Code is the Bugzilla Bug Tracking System. + # + # Contributor(s): Max Kanat-Alexander + #%] + +[%# INTERFACE: + # + # 'updated_XXX' variables are booleans, and are defined if the + # 'XXX' field was updated during the edit just being handled. + # Variables called just 'XXX' are strings, and are the _new_ contents + # of the fields. + # + # value & updated_value: the name of the field value + # sortkey & updated_sortkey: the field value sortkey + # field: string; the field that the value belongs to + #%] + +[% title = BLOCK %]Updating Value '[% value FILTER html %]' of the + '[% field FILTER html %]' Field[% END %] +[% PROCESS global/header.html.tmpl + title = title +%] + +[% IF updated_value %] +

Updated field value to: '[% value FILTER html %]'.

+[% END %] + +[% IF updated_sortkey %] +

Updated field value sortkey to: '[% sortkey FILTER html %]'.

+[% END %] + +[% UNLESS (updated_sortkey || updated_value) %] +

Nothing changed for field value '[% value FILTER html %]'. +[% END %] + +

+ +[% PROCESS admin/fieldvalues/footer.html.tmpl %] + +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/table.html.tmpl b/template/en/default/admin/table.html.tmpl index fd1382b14..4254f80e1 100644 --- a/template/en/default/admin/table.html.tmpl +++ b/template/en/default/admin/table.html.tmpl @@ -33,6 +33,12 @@ # content: If specified, the content of this variable is used # instead of the data pulled from the current row. # NOTE: This value is not HTML filtered at output! + # content_use_field: If defined and true, then each value in the + # column corresponds with a key in the + # field_descs field, and that value from the + # field_descs hash will be used instead of "content." + # See fieldvalues/select-field for an example of use. + # This content WILL be HTML-filtered in this case. # align: left/center/right. Controls the horizontal alignment of the # text in the column. # allow_html_content: if defined, then this column allows html content @@ -46,6 +52,8 @@ # #%] +[% PROCESS "global/field-descs.none.tmpl" %] + [%################### TABLE HEADER ######################%] @@ -77,8 +85,11 @@ [% END %] - [% IF c.content %] - [% c.content %] + [% IF c.content_use_field %] + [% colname = row.${c.name} %] + [% field_descs.${colname} FILTER html %] + [% ELSIF c.content %] + [% c.content %] [% ELSE %] [% IF c.yesno_field %] [% IF row.${c.name} %] diff --git a/template/en/default/global/useful-links.html.tmpl b/template/en/default/global/useful-links.html.tmpl index b9a69a9e9..eb8c7e24c 100644 --- a/template/en/default/global/useful-links.html.tmpl +++ b/template/en/default/global/useful-links.html.tmpl @@ -78,19 +78,15 @@ IF user.groups.tweakparams %] [% ' | Users' IF user.groups.editusers || user.can_bless %] - [% IF Param('useclassification') %] - [% IF user.groups.editclassifications %] + [% IF Param('useclassification') && user.groups.editclassifications %] [% ' | Classifications' %] - [% END %] - [% IF user.groups.editcomponents %] - [% ' | Products' %] - [% END %] - [% ELSE %] - [% ' | Products' + [% END %] + [% ' | Products' IF user.groups.editcomponents %] - [% END %] [% ' | Flags' IF user.groups.editcomponents %] + [% ' | Field Values' + IF user.groups.editcomponents %] [% ' | Groups' IF user.groups.creategroups %] [% ' | Keywords' diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index 55c796924..47dcaca10 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -321,6 +321,49 @@ Sorry; you do not have the permissions necessary to enter [% terms.abug %] against the [% product FILTER html %] product. + [% ELSIF error == "fieldname_invalid" %] + [% title = "Specified Field Does Not Exist" %] + The field '[% field 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 + '[%- field 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_name_too_long" %] + [% title = "Field Value Is Too Long" %] + The value of a field is limited to 60 characters. + '[% value FILTER html %]' is too long ([% value.length %] characters). + + [% ELSIF error == "fieldvalue_not_specified" %] + [% title = "Field Value Not Specified" %] + No field value specified when trying to edit a field value. + + [% ELSIF error == "fieldvalue_sortkey_invalid" %] + [% title = "Invalid Field Value Sortkey" %] + The sortkey '[% sortkey FILTER html %]' for the '[% name FILTER html %]' + field is not a valid (positive) number. + + [% ELSIF error == "fieldvalue_still_has_bugs" %] + [% title = "You Cannot Delete This Field Value" %] + You cannot delete the value '[% value FILTER html %]' from the + '[% field FILTER html%]' field, because there are still + [% count FILTER html %] [% terms.bugs %] using it. + + [% ELSIF error == "fieldvalue_undefined" %] + [% title = "Undefined Value Not Allowed" %] + You must specify a value. + [% ELSIF error == "file_not_specified" %] [% title = "No File Specified" %] You did not specify a file to attach. -- cgit v1.2.3-24-g4f1b