diff options
Diffstat (limited to 'httemplate/elements/select-cust_main-status.html')
-rw-r--r-- | httemplate/elements/select-cust_main-status.html | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/httemplate/elements/select-cust_main-status.html b/httemplate/elements/select-cust_main-status.html new file mode 100644 index 000000000..bdbaac7f4 --- /dev/null +++ b/httemplate/elements/select-cust_main-status.html @@ -0,0 +1,33 @@ +<SELECT NAME="<% $opt{'field'} || 'status' %>" + <% $opt{'multiple'} ? 'MULTIPLE' : '' %> + <% $onchange %> +> + + <OPTION VALUE="">all + +% foreach my $option ( @{ $opt{'statuses'} } ) { + + <OPTION VALUE="<% $option %>" + <% ref($value) && $value->{$option} || $option eq $value + ? 'SELECTED' : '' + %> + ><% $option %> + +% } + +</SELECT> + +<%init> + +my %opt = @_; + +$opt{'statuses'} ||= [ FS::cust_main->statuses() ]; # { disabled=>'' } ) + +my $onchange = $opt{'onchange'} + ? 'onChange="'. $opt{'onchange'}. '(this)"' + : ''; + +my $value = $opt{'curr_value'} || $opt{'value'}; +$value = [ split(/\s*,\s*/, $value) ] if $opt{'multiple'} && $value =~ /,/; + +</%init> |