summaryrefslogtreecommitdiffstats
path: root/template/en
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2007-07-05 04:05:58 +0200
committerlpsolit%gmail.com <>2007-07-05 04:05:58 +0200
commit223bd464bdfc6bcdff59e698ff3875eed7988207 (patch)
tree28e29367981b5104f829afe8b9405b2d52596737 /template/en
parent09b34ef6593a89e0e9a364fe73a2b1aed80741e7 (diff)
downloadbugzilla-223bd464bdfc6bcdff59e698ff3875eed7988207.tar.gz
bugzilla-223bd464bdfc6bcdff59e698ff3875eed7988207.tar.xz
Bug 339437: Make flag requestee a select box and limit users to requestable only - Patch by Seth <laoseth@gmail.com> r/a=LpSolit
Diffstat (limited to 'template/en')
-rw-r--r--template/en/default/attachment/edit.html.tmpl2
-rw-r--r--template/en/default/flag/list.html.tmpl67
-rw-r--r--template/en/default/global/userselect.html.tmpl7
3 files changed, 59 insertions, 17 deletions
diff --git a/template/en/default/attachment/edit.html.tmpl b/template/en/default/attachment/edit.html.tmpl
index 94581ab56..d0a75b3fd 100644
--- a/template/en/default/attachment/edit.html.tmpl
+++ b/template/en/default/attachment/edit.html.tmpl
@@ -40,8 +40,6 @@
table.attachment_info th { text-align: right; vertical-align: top; }
table.attachment_info td { text-align: left; vertical-align: top; }
#noview { text-align: left; vertical-align: middle; }
-
- table#flags th, table#flags td { font-size: small; vertical-align: baseline; text-align: left; }
"
%]
diff --git a/template/en/default/flag/list.html.tmpl b/template/en/default/flag/list.html.tmpl
index 61ecf2dfa..308552d25 100644
--- a/template/en/default/flag/list.html.tmpl
+++ b/template/en/default/flag/list.html.tmpl
@@ -45,10 +45,19 @@
function disableRequesteeFields()
{
var inputElements = document.getElementsByTagName("input");
+ var selectElements = document.getElementsByTagName("select");
+ //You cannot update Node lists, so you must create an array to combine the NodeLists
+ var allElements = [];
+ for( var i=0; i < inputElements.length; i++ ) {
+ allElements[allElements.length] = inputElements.item(i);
+ }
+ for( var i=0; i < selectElements.length; i++ ) { //Combine inputs with selects
+ allElements[allElements.length] = selectElements.item(i);
+ }
var inputElement, id, flagField;
- for ( var i=0 ; i<inputElements.length ; i++ )
+ for ( var i=0 ; i<allElements.length ; i++ )
{
- inputElement = inputElements.item(i);
+ inputElement = allElements[i];
if (inputElement.name.search(/^requestee(_type)?-(\d+)$/) != -1)
{
// Convert the ID of the requestee field into the ID of its corresponding
@@ -130,13 +139,23 @@
<td>
[% IF type.is_active && type.is_requesteeble %]
<span style="white-space: nowrap;">
- (<input type="text" size="30" maxlength="255"
- id="requestee-[% flag.id %]"
- name="requestee-[% flag.id %]"
- [% IF flag.status == "?" && flag.requestee %]
- value="[% flag.requestee.login FILTER html %]"
- [% END %]
- >)
+ [% IF Param('usemenuforusers') %]
+ [% INCLUDE global/userselect.html.tmpl
+ name => "requestee-$flag.id"
+ id => "requestee-$flag.id"
+ value => flag.requestee.login
+ multiple => 0
+ emptyok => 1
+ custom_userlist => flag.type.grant_list
+ %]
+ [% ELSE %]
+ (<input type="text" size="30" maxlength="255"
+ id="requestee-[% flag.id %]"
+ name="requestee-[% flag.id %]"
+ [% IF flag.status == "?" && flag.requestee %]
+ value="[% flag.requestee.login FILTER html %]"
+ [% END %]>)
+ [% END %]
</span>
[% END %]
</td>
@@ -173,9 +192,19 @@
<td>
[% IF type.is_requesteeble %]
<span style="white-space: nowrap;">
- (<input type="text" size="30" maxlength="255"
- id="requestee_type-[% type.id %]"
- name="requestee_type-[% type.id %]">)
+ [% IF Param('usemenuforusers') %]
+ [% INCLUDE global/userselect.html.tmpl
+ name => "requestee_type-$type.id"
+ id => "requestee_type-$type.id"
+ multiple => type.is_multiplicable * 3
+ emptyok => !type.is_multiplicable
+ custom_userlist => type.grant_list
+ %]
+ [% ELSE %]
+ (<input type="text" size="30" maxlength="255"
+ id="requestee_type-[% type.id %]"
+ name="requestee_type-[% type.id %]">)
+ [% END %]
</span>
[% END %]
</td>
@@ -216,11 +245,21 @@
[% IF any_flags_requesteeble %]
<td>
[% IF type.is_requesteeble %]
- <span style="white-space: nowrap;">
+ <span style="white-space: nowrap;">
+ [% IF Param('usemenuforusers') %]
+ [% INCLUDE global/userselect.html.tmpl
+ name => "requestee_type-$type.id"
+ id => "requestee_type-$type.id"
+ multiple => type.is_multiplicable * 3
+ emptyok => !type.is_multiplicable
+ custom_userlist => type.grant_list
+ %]
+ [% ELSE %]
(<input type="text" size="30" maxlength="255"
id="requestee_type-[% type.id %]"
name="requestee_type-[% type.id %]">)
- </span>
+ [% END %]
+ </span>
[% END %]
</td>
[% END %]
diff --git a/template/en/default/global/userselect.html.tmpl b/template/en/default/global/userselect.html.tmpl
index 398300b52..8fa7e0360 100644
--- a/template/en/default/global/userselect.html.tmpl
+++ b/template/en/default/global/userselect.html.tmpl
@@ -25,6 +25,7 @@
# 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
#%]
[% IF Param("usemenuforusers") %]
@@ -45,7 +46,11 @@
</option>
[% END %]
- [% FOREACH tmpuser = user.get_userlist %]
+ [% UNLESS custom_userlist %]
+ [% custom_userlist = user.get_userlist %]
+ [% END %]
+
+ [% FOREACH tmpuser = custom_userlist %]
[% IF tmpuser.visible OR value.match("\\b$tmpuser.login\\b") %]
<option value="[% tmpuser.login FILTER html %]"
[% " selected=\"selected\"" IF value.match("\\b$tmpuser.login\\b") %]