aboutsummaryrefslogtreecommitdiffstats
path: root/template/en/default
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2008-12-29 00:02:12 +0000
committerlpsolit%gmail.com <>2008-12-29 00:02:12 +0000
commit43a2416049c49a85ce84ede5567889d061a4e946 (patch)
treee623608c6dce308e6d94a9d3a162c8ff93a95e18 /template/en/default
parent4240812eb919847f4a20ecbde9b946a9e8b50038 (diff)
downloadbugs-43a2416049c49a85ce84ede5567889d061a4e946.tar
bugs-43a2416049c49a85ce84ede5567889d061a4e946.tar.gz
bugs-43a2416049c49a85ce84ede5567889d061a4e946.tar.bz2
bugs-43a2416049c49a85ce84ede5567889d061a4e946.tar.xz
bugs-43a2416049c49a85ce84ede5567889d061a4e946.zip
Bug 465589: Already selected user accounts are no longer displayed when usemenuforusers is enabled and the account has been disabled - Patch by Frédéric Buclin <LpSolit@gmail.com> r=wicked a=LpSolit
Diffstat (limited to 'template/en/default')
-rw-r--r--template/en/default/admin/components/create.html.tmpl3
-rw-r--r--template/en/default/bug/create/create.html.tmpl32
-rw-r--r--template/en/default/bug/edit.html.tmpl1
-rw-r--r--template/en/default/global/userselect.html.tmpl27
-rw-r--r--template/en/default/list/edit-multiple.html.tmpl2
5 files changed, 49 insertions, 16 deletions
diff --git a/template/en/default/admin/components/create.html.tmpl b/template/en/default/admin/components/create.html.tmpl
index 86411adad..0949837fc 100644
--- a/template/en/default/admin/components/create.html.tmpl
+++ b/template/en/default/admin/components/create.html.tmpl
@@ -52,7 +52,6 @@
[% INCLUDE global/userselect.html.tmpl
name => "initialowner"
id => "initialowner"
- value => ""
size => 64
%]
</td>
@@ -65,7 +64,6 @@
[% INCLUDE global/userselect.html.tmpl
name => "initialqacontact"
id => "initialqacontact"
- value => ""
size => 64
emptyok => 1
%]
@@ -80,7 +78,6 @@
[% INCLUDE global/userselect.html.tmpl
name => "initialcc"
id => "initialcc"
- value => ""
size => 64
multiple => 5
%]
diff --git a/template/en/default/bug/create/create.html.tmpl b/template/en/default/bug/create/create.html.tmpl
index 089292603..5b99d38ba 100644
--- a/template/en/default/bug/create/create.html.tmpl
+++ b/template/en/default/bug/create/create.html.tmpl
@@ -206,11 +206,23 @@ function handleWantsAttachment(wants_attachment) {
</th>
<td>
<select name="component" onchange="set_assign_to();" size="7">
+ [%# Build the lists of assignees and QA contacts if "usemenuforusers" is enabled. %]
+ [% IF Param("usemenuforusers") %]
+ [% assignees_list = user.get_userlist.clone %]
+ [% qa_contacts_list = user.get_userlist.clone %]
+ [% END %]
+
[%- FOREACH c = product.components %]
<option value="[% c.name FILTER html %]"
[% " selected=\"selected\"" IF c.name == default.component_ %]>
[% c.name FILTER html -%]
</option>
+ [% IF Param("usemenuforusers") %]
+ [% INCLUDE build_userlist default_user = c.default_assignee,
+ userlist = assignees_list %]
+ [% INCLUDE build_userlist default_user = c.default_qa_contact,
+ userlist = qa_contacts_list %]
+ [% END %]
[%- END %]
</select>
</td>
@@ -352,6 +364,7 @@ function handleWantsAttachment(wants_attachment) {
disabled => assigned_to_disabled
size => 30
emptyok => 1
+ custom_userlist => assignees_list
%]
<noscript>(Leave blank to assign to component's default assignee)</noscript>
</td>
@@ -367,6 +380,7 @@ function handleWantsAttachment(wants_attachment) {
disabled => qa_contact_disabled
size => 30
emptyok => 1
+ custom_userlist => qa_contacts_list
%]
<noscript>(Leave blank to assign to default qa contact)</noscript>
</td>
@@ -651,3 +665,21 @@ function handleWantsAttachment(wants_attachment) {
[% END %]
</td>
[% END %]
+
+[% BLOCK build_userlist %]
+ [% user_found = 0 %]
+ [% default_login = default_user.login %]
+ [% RETURN UNLESS default_login %]
+
+ [% FOREACH user = userlist %]
+ [% IF user.login == default_login %]
+ [% user_found = 1 %]
+ [% LAST %]
+ [% END %]
+ [% END %]
+
+ [% userlist.push({login => default_login,
+ identity => default_user.identity,
+ visible => 1})
+ UNLESS user_found %]
+[% END %]
diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl
index 73efa0b6c..4cb5017e1 100644
--- a/template/en/default/bug/edit.html.tmpl
+++ b/template/en/default/bug/edit.html.tmpl
@@ -871,7 +871,6 @@
[% INCLUDE global/userselect.html.tmpl
id => "newcc"
name => "newcc"
- value => ""
size => 30
multiple => 5
%]
diff --git a/template/en/default/global/userselect.html.tmpl b/template/en/default/global/userselect.html.tmpl
index e27ca0d6f..35075ef9d 100644
--- a/template/en/default/global/userselect.html.tmpl
+++ b/template/en/default/global/userselect.html.tmpl
@@ -11,6 +11,7 @@
# The Original Code is the Bugzilla Bug Tracking System.
#
# Contributor(s): Byron Jones <bugzilla@glob.com.au>
+ # Frédéric Buclin <LpSolit@gmail.com>
#%]
[%# INTERFACE:
@@ -23,7 +24,6 @@
# size: optional, input only; size attribute value
# emptyok: optional, select only; if true, prepend menu option to start of select
# multiple: optional, do multiselect box, value is size (height) of box
- # do_not_change: optional, contains the string meaning "do not alter this role"
# custom_userlist: optional, specify a limited list of users to use
#%]
@@ -39,27 +39,34 @@
<option value=""></option>
[% END %]
- [% IF do_not_change %]
- <option value="[% do_not_change FILTER html %]">
- [% do_not_change FILTER html %]
- </option>
- [% END %]
-
[% UNLESS custom_userlist %]
[% custom_userlist = user.get_userlist %]
[% END %]
[% SET selected = {} %]
- [% FOREACH selected_value IN value.split(', ') %]
- [% SET selected.$selected_value = 1 %]
+ [% IF value.defined %]
+ [% FOREACH selected_value IN value.split(', ') %]
+ [% SET selected.$selected_value = 1 %]
+ [% END %]
[% END %]
+
[% FOREACH tmpuser = custom_userlist %]
[% IF tmpuser.visible OR selected.${tmpuser.login} == 1 %]
<option value="[% tmpuser.login FILTER html %]"
- [% " selected=\"selected\"" IF selected.${tmpuser.login} == 1 %]
+ [% IF selected.${tmpuser.login} == 1 %]
+ selected="selected"
+ [%# A user account appears only once. Remove it from the list, so that
+ # we know if there are some selected accounts which have not been listed. %]
+ [% selected.delete(tmpuser.login) %]
+ [% END %]
>[% tmpuser.identity FILTER html %]</option>
[% END %]
[% END %]
+
+ [%# If the list is not empty, this means some accounts have not been mentioned yet. %]
+ [% FOREACH selected_user = selected.keys %]
+ <option value="[% selected_user FILTER html %]" selected="selected">[% selected_user FILTER html %]</option>
+ [% END %]
</select>
[% ELSE %]
<input
diff --git a/template/en/default/list/edit-multiple.html.tmpl b/template/en/default/list/edit-multiple.html.tmpl
index d49709dbc..9fa5a1088 100644
--- a/template/en/default/list/edit-multiple.html.tmpl
+++ b/template/en/default/list/edit-multiple.html.tmpl
@@ -173,7 +173,6 @@
id => "assigned_to"
name => "assigned_to"
value => dontchange
- do_not_change => dontchange
size => 32
%]
<input type="checkbox" id="set_default_assignee" name="set_default_assignee" value="1">
@@ -189,7 +188,6 @@
id => "qa_contact"
name => "qa_contact"
value => dontchange
- do_not_change => dontchange
size => 32
%]
<input type="checkbox" id="set_default_qa_contact" name="set_default_qa_contact" value="1">