summaryrefslogtreecommitdiff
path: root/httemplate/elements/select-ticketing_queueid.html
blob: 540b38de7f58171a0eb873bd24147a83c33db24c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<SELECT NAME="ticketing_queueid">

  <OPTION VALUE="" <% ! $opt{curr_value} ? 'SELECTED' : '' %>><% $opt{empty_label} %>

% foreach my $queueid ( sort { $a <=> $b } keys %queues ) {
    <OPTION VALUE="<% $queueid %>" <% $opt{curr_value} == $queueid ? ' SELECTED' : '' %>><% $queueid %>: <% $queues{$queueid} %>
% } 

% while ( @post_options ) { 
%   my $post_opt   = shift(@post_options);
%   my $post_label = shift(@post_options);
%   my $selected = ( $opt{curr_value} eq $post_opt );
    <OPTION VALUE="<% $post_opt %>"
            <% $selected ? 'SELECTED' : '' %>
    ><% $post_label %>
% } 

</SELECT>

<%init>

my %opt = @_;

my $conf = new FS::Conf;

my %queues = ();
if ( $conf->config('ticket_system') ) {
   %queues = FS::TicketSystem->queues();
}

my @post_options  = $opt{post_options}  ? @{ $opt{post_options} } : ();

</%init>