Optimize "Customer has a referring customer" condition, RT#74452
[freeside.git] / httemplate / elements / select-ticketing_queueid.html
1 <SELECT NAME="ticketing_queueid">
2
3   <OPTION VALUE="" <% ! $opt{curr_value} ? 'SELECTED' : '' %>><% $opt{empty_label} %>
4
5 % foreach my $queueid ( sort { $a <=> $b } keys %queues ) {
6     <OPTION VALUE="<% $queueid %>" <% $opt{curr_value} == $queueid ? ' SELECTED' : '' %>><% $queueid %>: <% $queues{$queueid} %>
7 % } 
8
9 % while ( @post_options ) { 
10 %   my $post_opt   = shift(@post_options);
11 %   my $post_label = shift(@post_options);
12 %   my $selected = ( $opt{curr_value} eq $post_opt );
13     <OPTION VALUE="<% $post_opt %>"
14             <% $selected ? 'SELECTED' : '' %>
15     ><% $post_label %>
16 % } 
17
18 </SELECT>
19
20 <%init>
21
22 my %opt = @_;
23
24 my $conf = new FS::Conf;
25
26 my %queues = ();
27 if ( $conf->config('ticket_system') ) {
28    %queues = FS::TicketSystem->queues();
29 }
30
31 my @post_options  = $opt{post_options}  ? @{ $opt{post_options} } : ();
32
33 </%init>