summaryrefslogtreecommitdiff
path: root/httemplate/elements/select-cust_main-status.html
blob: 2e0b6cb249081b190f6dba3c14aa65bf6b397a14 (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_main->statuses() ]; # { disabled=>'' } )

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

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

</%init>