From 2a5d8de847971f7b5476ad6026fcbfcb68813354 Mon Sep 17 00:00:00 2001 From: "travis%sedsystems.ca" <> Date: Tue, 1 Mar 2005 04:41:42 +0000 Subject: Bug 119485 : Templatise editusers.cgi Patch by Marc Schumann r=GavinS, mkanat a=justdave --- template/en/default/admin/groups/delete.html.tmpl | 2 +- .../default/admin/users/confirm-delete.html.tmpl | 404 +++++++++++++++++++++ template/en/default/admin/users/create.html.tmpl | 57 +++ template/en/default/admin/users/edit.html.tmpl | 154 ++++++++ template/en/default/admin/users/list.html.tmpl | 98 +++++ .../default/admin/users/listselectvars.html.tmpl | 34 ++ template/en/default/admin/users/search.html.tmpl | 70 ++++ template/en/default/admin/users/userdata.html.tmpl | 79 ++++ template/en/default/filterexceptions.pl | 25 ++ template/en/default/global/code-error.html.tmpl | 6 +- template/en/default/global/messages.html.tmpl | 72 +++- template/en/default/global/user-error.html.tmpl | 14 + 12 files changed, 1012 insertions(+), 3 deletions(-) create mode 100644 template/en/default/admin/users/confirm-delete.html.tmpl create mode 100644 template/en/default/admin/users/create.html.tmpl create mode 100644 template/en/default/admin/users/edit.html.tmpl create mode 100644 template/en/default/admin/users/list.html.tmpl create mode 100644 template/en/default/admin/users/listselectvars.html.tmpl create mode 100644 template/en/default/admin/users/search.html.tmpl create mode 100644 template/en/default/admin/users/userdata.html.tmpl (limited to 'template/en') diff --git a/template/en/default/admin/groups/delete.html.tmpl b/template/en/default/admin/groups/delete.html.tmpl index 842e2c6f1..2c4b70862 100644 --- a/template/en/default/admin/groups/delete.html.tmpl +++ b/template/en/default/admin/groups/delete.html.tmpl @@ -56,7 +56,7 @@

One or more users belong to this group. You cannot delete this group while there are users in it. -
Show +
Show me which users - Remove all users from this group for me.

[% END %] diff --git a/template/en/default/admin/users/confirm-delete.html.tmpl b/template/en/default/admin/users/confirm-delete.html.tmpl new file mode 100644 index 000000000..ece5de7e0 --- /dev/null +++ b/template/en/default/admin/users/confirm-delete.html.tmpl @@ -0,0 +1,404 @@ +[%# 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): Marc Schumann + #%] + +[%# INTERFACE: + # + # listselectionvalues: selection values to recreate the current user + # list. + # editusers: is viewing user member of editusers? + # editcomponents: is viewing user member of editcomponents? + # otheruser: Bugzilla::User object of the viewed user. + # groups: array of Group names the viewed user is a member + # of. + # product_responsibilities: list of hashes, one entry per Bugzilla component. + # productname: Name of the product. + # componentname: Name of the component. + # initialowner: User ID of initial owner. + # initialqacontact: User ID of initial QA contact. + # bugs: number of bugs the viewed user has a role in + # bug_activity: number of bugs the viewed user has activity + # entries on + # cc number of bugs the viewed user is cc list member + # of + # flags.requestee: number of flags the viewed user is being asked for + # flags.setter: number of flags the viewed user has set + # longdescs: number of bug comments the viewed user has written + # namedqueries: number of named queries the user has created + # profiles_activity: number of named queries the user has created + # series: number of series the viewed user has created + # votes: number of bugs the viewed user has voted on + # watch.watched: number of users the viewed user is being watched + # by + # watch.watcher: number of users the viewed user is watching + # whine_events: number of whine events the viewed user has created + # whine_schedules: number of whine schedules the viewed user has + # created + #%] + +[% PROCESS global/header.html.tmpl + title = "Confirm deletion of user $otheruser.login" + style_urls = ['skins/standard/admin.css', + 'skins/standard/editusers.css'] +%] + +[% PROCESS admin/users/listselectvars.html.tmpl + listselectionvalues = listselectionvalues +%] + +[% responsibilityterms = { + 'initialowner' => 'Initial Owner', + 'initialqacontact' => 'Initial QA Contact' + } +%] + + + + + + + + + + + + + + + [% IF product_responsibilities.size %] + + + + + [% END %] +
Login name:[% otheruser.login FILTER html %]
Real name:[% otheruser.name FILTER html %]
Group set: + [% IF groups.size %] +
    + [% FOREACH group = groups %] +
  • [% group.name FILTER html %]
  • + [% END %] +
+ [% ELSE %] + None + [% END %] +
Product responsibilities: + +
+ +[% IF product_responsibilities.size %] +

+ You can't delete this user at this time because + [%+ otheruser.login FILTER html %] has got responsibilities for at least + one product. +

+

+ [% IF editcomponents %] + Change this by clicking the product editing links above, + [% ELSE %] + For now, you can + [% END %] +[% ELSE %] + +

Confirmation

+ + [% IF bugs || bug_activity || cc || flags.requestee || flags.setter || + longdescs || namedqueries || profiles_activity || series || votes || + watch.watched || watch.watcher || whine_events || whine_schedules %] + +

+ Please be aware of the consequences of this before continuing. +

+ [% END %] + +

Do you really want to delete this user account?

+ +
+

+ + + + [% INCLUDE listselectionhiddenfields %] +

+
+ +

If you do not want to delete the user account at this time, +[% END %] + + edit the user, + go + back + to the user list, + [% IF editusers %] + add + a new user, + [% END %] + or find other users. +

+ +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/users/create.html.tmpl b/template/en/default/admin/users/create.html.tmpl new file mode 100644 index 000000000..42aefbdb7 --- /dev/null +++ b/template/en/default/admin/users/create.html.tmpl @@ -0,0 +1,57 @@ +[%# 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): Marc Schumann + #%] + +[%# INTERFACE: + # + # listselectionvalues: selection values to recreate the current user list. + # editusers: is viewing user member of editusers? + #%] + +[% PROCESS global/header.html.tmpl + title = "Add user" + style_urls = ['skins/standard/editusers.css'] + onload = "document.forms['f'].login.focus()" +%] + +[% PROCESS admin/users/listselectvars.html.tmpl + listselectionvalues = listselectionvalues +%] + +
+ + [% PROCESS admin/users/userdata.html.tmpl + editform = 0 + editusers = editusers + otheruser = [] + %] +
+

+ + + [% INCLUDE listselectionhiddenfields %] +

+
+ +

+ You can also find a user + [% IF listselectionvalues %], + or + go + back to the user list + [% END %]. +

+ +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/users/edit.html.tmpl b/template/en/default/admin/users/edit.html.tmpl new file mode 100644 index 000000000..53ea17f21 --- /dev/null +++ b/template/en/default/admin/users/edit.html.tmpl @@ -0,0 +1,154 @@ +[%# 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): Marc Schumann + #%] + +[%# INTERFACE: + # + # message: message tag specifying a global/messages.html.tmpl + # message + # listselectionvalues: selection values to recreate the current user list. + # editusers: is viewing user member of editusers? + # otheruser: Bugzilla::User object of viewed user. + # groups: array of group information (name, grant type, + # canbless) for viewed user. + #%] + +[% PROCESS global/header.html.tmpl + title = "Edit user $login" + message = message + style_urls = ['skins/standard/editusers.css'] +%] + +[% PROCESS admin/users/listselectvars.html.tmpl + listselectionvalues = listselectionvalues +%] + +
+ + [% PROCESS admin/users/userdata.html.tmpl + editform = 1 + editusers = editusers + otheruser = otheruser + %] + [% IF groups.size %] + + + + + [% END %] +
Group access: + + + [% IF editusers %] + + [% END %] + + + [% IF editusers %] + + [% END %] + + + [% FOREACH group = groups %] + [% perms = permissions.${group.id} %] + + [% IF editusers %] + + [% END %] + + + + [% END %] +
+ Can turn these [% terms.bits %] on for other users +
|User is a member of these groups
+ [% '[' IF perms.indirectbless %] + [% %] + [% ']' IF perms.indirectbless %] + [% %] + [% '[' IF perms.derivedmember %] + [% '*' IF perms.regexpmember %] + [%%] + [% '*' IF perms.regexpmember %] + [% ']' IF perms.derivedmember %] + [% %] + +
+
+ +

+ + + + [% INCLUDE listselectionhiddenfields %] +

+
+

+ User is a member of any groups shown with a check or grey bar. + A grey bar indicates indirect membership, either derived from other + groups (marked with square brackets) or via regular expression + (marked with '*'). +

+[% IF editusers %] +

+ Square brackets around the bless checkbox indicate the ability + to bless users (grant them membership in the group) as a result + of membership in another group. +

+[% END %] + +[% IF Param('allowuserdeletion') && editusers %] +
+

+ + + + [% INCLUDE listselectionhiddenfields %] +

+
+[% END %] + +

+ You can also + [% IF editusers %] + add + a new user + [% IF listselectionvalues %], + [% END %] + [% END %] + [% IF listselectionvalues %] + go + back + to the user list, + [% END %] + [% IF editusers OR listselectionvalues %] + or + [% END %] + find other users. +

+ +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/users/list.html.tmpl b/template/en/default/admin/users/list.html.tmpl new file mode 100644 index 000000000..9cbd7530d --- /dev/null +++ b/template/en/default/admin/users/list.html.tmpl @@ -0,0 +1,98 @@ +[%# 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): Marc Schumann + #%] + +[%# INTERFACE: + # + # listselectionvalues: selection values to recreate the current user list. + # editusers: is viewing user member of editusers? + # users: list of user information (id, login_name, realname, + # disabledtext). + #%] + +[% PROCESS global/header.html.tmpl + title = "Select user" + style_urls = ['skins/standard/editusers.css'] +%] + +[% PROCESS admin/users/listselectvars.html.tmpl + listselectionvalues = listselectionvalues +%] + +[% listselectionurlparams = INCLUDE listselectionurlparams %] + +[% columns = + [{name => 'login_name' + heading => 'Edit user...' + contentlink => 'editusers.cgi?action=edit&userid=%%userid%%' _ + listselectionurlparams + allow_html_content => 1 + } + {name => 'realname' + heading => 'Real name' + allow_html_content => 1 + } + ] +%] + +[% IF Param('allowuserdeletion') && editusers %] + [% columns.push({heading => 'Action' + content => 'Delete' + contentlink => 'editusers.cgi?action=del' _ + '&userid=%%userid%%' _ + listselectionurlparams + } + ) + %] +[% END %] + +[% FOREACH thisuser = users %] + [%# We FILTER html here because we need admin/table.html.tmpl to accept HTML + # for styling, so we cannot let admin/table.html.tmpl do the FILTER. + #%] + [% thisuser.login_name = BLOCK %] + [% thisuser.login_name FILTER html %] + [% END %] + [% IF thisuser.realname %] + [% thisuser.realname = BLOCK %] + [% thisuser.realname FILTER html %] + [% END %] + [% ELSE %] + [% SET thisuser.realname = 'missing' %] + [% END %] + [% IF thisuser.disabledtext %] + [% thisuser.login_name = "$thisuser.login_name" %] + [% thisuser.realname = "$thisuser.realname" %] + [% END %] +[% END %] + +

[% users.size %] user[% "s" UNLESS users.size == 1 %] found.

+ +[% PROCESS admin/table.html.tmpl + columns = columns + data = users +%] + +

+ If you do not wish to modify a user account at this time, you can + find other users + [% IF editusers %] + or + add + a new user + [% END %]. +

+ +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/users/listselectvars.html.tmpl b/template/en/default/admin/users/listselectvars.html.tmpl new file mode 100644 index 000000000..781e85a7d --- /dev/null +++ b/template/en/default/admin/users/listselectvars.html.tmpl @@ -0,0 +1,34 @@ +[%# 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): Marc Schumann + #%] + +[%# INTERFACE: + # + # listselectionvalues: selection values to recreate the current user list. + #%] + +[% BLOCK listselectionurlparams %] + [% FOREACH field = listselectionvalues.keys %]& + [% field FILTER url_quote %]= + [% listselectionvalues.$field FILTER url_quote %] + [% END %] +[% END %] + +[% BLOCK listselectionhiddenfields %] + [% FOREACH field = listselectionvalues.keys %] + + [% END %] +[% END %] diff --git a/template/en/default/admin/users/search.html.tmpl b/template/en/default/admin/users/search.html.tmpl new file mode 100644 index 000000000..748670a68 --- /dev/null +++ b/template/en/default/admin/users/search.html.tmpl @@ -0,0 +1,70 @@ +[%# 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): Marc Schumann + #%] + +[%# INTERFACE: + # + # editusers: is viewing user member of editusers? + # restrictablegroups: list of groups visible to the user: + # id: group id + # name: group name + #%] + + +[% PROCESS global/header.html.tmpl + title = "Search users" + style_urls = ['skins/standard/editusers.css'] + onload = "document.forms['f'].matchstr.focus()" +%] + +[% PROCESS admin/users/listselectvars.html.tmpl + listselectionvalues = listselectionvalues +%] + +
+ +

+ + +

+ +[% IF restrictablegroups.size %] +

+ +

+[% END %] +
+ +[% IF editusers %] +

+ You can also add a new user + [%- IF listselectionvalues %], + or + show + the user list again + [%- END %]. +

+[% END %] + +[% PROCESS global/footer.html.tmpl %] diff --git a/template/en/default/admin/users/userdata.html.tmpl b/template/en/default/admin/users/userdata.html.tmpl new file mode 100644 index 000000000..43ee627f1 --- /dev/null +++ b/template/en/default/admin/users/userdata.html.tmpl @@ -0,0 +1,79 @@ +[%# 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): Marc Schumann + #%] + +[%# INTERFACE: + # + # editform: is this an edit form? (It's a create form otherwise) + # editusers: is viewing user member of editusers? + # otheruser: Bugzilla::User object of user to edit + #%] + + + + + [% IF editusers %] + + [% IF editform %] + + [% END %] + [% ELSE %] + [% otheruser.login FILTER html %] + [% END %] + + + + + + [% IF editusers %] + + [% IF editform %] + + [% END %] + [% ELSE %] + [% otheruser.name FILTER html %] + [% END %] + + +[% IF editusers %] + + + + + [% IF editform %]
+ (Enter new password to change.) + [% END %] + + + + + +
+ (If non-empty, then the account will be disabled, and this text should + explain why.) + [% IF editform %] + + [% END %] + + +[% END %] diff --git a/template/en/default/filterexceptions.pl b/template/en/default/filterexceptions.pl index 94a4168e2..bcbbcc8a5 100644 --- a/template/en/default/filterexceptions.pl +++ b/template/en/default/filterexceptions.pl @@ -581,6 +581,31 @@ 'deleted_bug_count' ], +'admin/users/confirm-delete.html.tmpl' => [ + 'andstring', + 'responsibilityterms.$responsibility', + 'bugs', + 'cc', + 'flags.requestee', + 'flags.setter', + 'longdescs', + 'namedqueries', + 'votes', + 'series', + 'watch.watched', + 'watch.watcher', + 'whine_events', + 'whine_schedules', + 'otheruser.id' +], + +'admin/users/edit.html.tmpl' => [ + 'otheruser.id', + 'group.id', + 'perms.directbless', + 'perms.directmember', +], + 'admin/components/edit.html.tmpl' => [ 'bug_count' ], diff --git a/template/en/default/global/code-error.html.tmpl b/template/en/default/global/code-error.html.tmpl index 3a2a9606e..259be667c 100644 --- a/template/en/default/global/code-error.html.tmpl +++ b/template/en/default/global/code-error.html.tmpl @@ -185,7 +185,11 @@ [% ELSIF error == "invalid_keyword_id" %] The keyword ID [% id FILTER html %] couldn't be found. - + + [% ELSIF error == "invalid_user_id" %] + [% title = "Invalid User ID" %] + There is no user account with ID [% userid FILTER html %]. + [% ELSIF error == "missing_bug_id" %] No [% terms.bug %] ID was given. diff --git a/template/en/default/global/messages.html.tmpl b/template/en/default/global/messages.html.tmpl index ba1476300..5ed2eecf8 100644 --- a/template/en/default/global/messages.html.tmpl +++ b/template/en/default/global/messages.html.tmpl @@ -30,7 +30,77 @@ [% message_tag = message %] [% message = BLOCK %] - [% IF message_tag == "buglist_adding_field" %] + [% IF message_tag == "account_created" %] + [% title = "User $otheruser.login created" %] + A new user account [% otheruser.login FILTER html %] has been created + successfully. + [% IF groups.size %] + You may want to edit the group settings now, using the form below. + [% END %] + + [% ELSIF message_tag == "account_updated" %] + [% IF changed_fields.size + + groups_added_to.size + groups_removed_from.size + + groups_granted_rights_to_bless.size + groups_denied_rights_to_bless.size %] + [% title = "User $loginold updated" %] + The following changes have been made to the user account + [%+ loginold FILTER html %]: +
    + [% FOREACH field = changed_fields %] +
  • + [% IF field == 'login_name' %] + The login is now [% otheruser.login FILTER html %]. + [% ELSIF field == 'realname' %] + The real name has been updated. + [% ELSIF field == 'cryptpassword' %] + A new password has been set. + [% ELSIF field == 'disabledtext' %] + The disable text has been modified. + [% END %] +
  • + [% END %] + [% IF groups_added_to.size %] +
  • + The account has been added to the + [%+ groups_added_to.join(', ') FILTER html %] + group[% 's' IF groups_added_to.size > 1 %]. +
  • + [% END %] + [% IF groups_removed_from.size %] +
  • + The account has been removed from the + [%+ groups_removed_from.join(', ') FILTER html %] + group[% 's' IF groups_removed_from.size > 1 %]. +
  • + [% END %] + [% IF groups_granted_rights_to_bless.size %] +
  • + The account has been granted rights to bless the + [%+ groups_granted_rights_to_bless.join(', ') FILTER html %] + group[% 's' IF groups_granted_rights_to_bless.size > 1 %]. +
  • + [% END %] + [% IF groups_denied_rights_to_bless.size %] +
  • + The account has been denied rights to bless the + [%+ groups_denied_rights_to_bless.join(', ') FILTER html %] + group[% 's' IF groups_denied_rights_to_bless.size > 1 %]. +
  • + [% END %] +
+ [% ELSE %] + [% title = "User $otheruser.login not changed" %] + You didn't request any change on the user account + [%+ otheruser.login FILTER html %]. + [% END %] + [%# changed_fields.join(', ') %] + + [% ELSIF message_tag == "account_deleted" %] + [% title = "User $otheruser.login deleted" %] + The user account [% otheruser.login FILTER html %] has been deleted + successfully. + + [% ELSIF message_tag == "buglist_adding_field" %] [% title = "Adding field to search page..." %] [% link = "Click here if the page does not redisplay automatically." %] diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index e0d43b5b1..eba6e97c6 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -108,6 +108,8 @@ [% IF group %] and [% END %] [% IF reason == "cant_bless" %] you don't have permissions to put people in or out of any group, + [% ELSIF reason == "not_visible" %] + there are visibility restrictions on certain user groups, [% END %] [% END %] @@ -146,6 +148,8 @@ products [% ELSIF object == "reports" %] whine reports + [% ELSIF object == "user" %] + the user you specified [% ELSIF object == "users" %] users [% ELSIF object == "versions" %] @@ -1046,6 +1050,16 @@ [% title = "Deletion not activated" %] Sorry, the deletion of user accounts is not allowed. + [% ELSIF error == "user_has_responsibility" %] + [% title = "Can't Delete User Account" %] + The user you want to delete is set up for roles as initial [% terms.bug %] + owner or QA contact for at least one component. + For this reason, you cannot delete the account at this time. + + [% ELSIF error == "user_login_required" %] + [% title = "Login Name Required" %] + You must enter a login name for the new user. + [% ELSIF error == "votes_must_be_nonnegative" %] [% title = "Votes Must Be Non-negative" %] Only use non-negative numbers for your [% terms.bug %] votes. -- cgit v1.2.3-24-g4f1b