summaryrefslogtreecommitdiff
path: root/httemplate/elements/select-cust_pkg-status.html
blob: 2d545c04736b64618ca36f30dc57de87f3b9f066 (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
<SELECT NAME="<% $opt{'field'} || 'status' %>"
        <% $opt{'multiple'} ? 'MULTIPLE' : '' %>
        <% $onchange %>
>

  <OPTION VALUE="">all

% foreach my $option ( @{ $opt{'statuses'} } ) { 

    <OPTION VALUE="<% $option %>"
            <% $option eq $curr_value ? 'SELECTED' : '' %>
    ><% $option %>

% } 

</SELECT>

<%init>

my %opt = @_;

$opt{'statuses'} ||= [ FS::cust_pkg->statuses() ]; # { disabled=>'' } )

my $onchange = $opt{'onchange'}
                 ? 'onChange="'. $opt{'onchange'}. '(this)"'
                 : '';

my $curr_value = $opt{'curr_value'} || $opt{'value'};

</%init>