<SELECT NAME=<%$Name%>>
<OPTION VALUE="" 
<% $Default eq 'none' && 'SELECTED' %>
>-</OPTION>
%while  (my $Template = $PrimaryTemplates->Next) {
<OPTION VALUE=<%$Template->Id%>
<% ($Template->Id == $Default) && 'SELECTED' %>
><%$Template->Name%>
</OPTION>
%}
%while  (my $Template = $OtherTemplates->Next) {
<OPTION VALUE=<%$Template->Id%>
<% ($Template->Id == $Default)  && 'SELECTED'%>
>Global template: <%$Template->Name%>
</OPTION>
%}
</SELECT>

<%INIT>


my $PrimaryTemplates = RT::Templates->new($session{'CurrentUser'});
if ($DefaultQueue != 0) {
$PrimaryTemplates->LimitToQueue($DefaultQueue);
}

my $OtherTemplates = RT::Templates->new($session{'CurrentUser'});
$OtherTemplates->LimitToGlobal($DefaultQueue);

</%INIT>
<%ARGS>

$Default => 'none'
$DefaultQueue => undef
$Name => 'Template'

</%ARGS>
