summaryrefslogtreecommitdiffstats
path: root/template/en/default/bug/create
diff options
context:
space:
mode:
Diffstat (limited to 'template/en/default/bug/create')
-rw-r--r--template/en/default/bug/create/create.html.tmpl32
1 files changed, 32 insertions, 0 deletions
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 %]