RT# 82137 - default payment amount now has processing fee in total if processing...
[freeside.git] / httemplate / elements / select-time.html
1 % unless ( $opt{'js_only'} ) {
2     <SELECT NAME="<% $opt{'field'} %>" SIZE="1" <%$disabled%> <%$onchange%> >
3 %     for ( my $t = 0; $t <=1440; $t += $increment ) {
4         <OPTION VALUE="<% $t %>"
5                 <%    ( $curr_value eq '' && $t == $selected_default )
6                    || $curr_value == $t
7                      ? 'SELECTED' : ''
8                 %>
9         ><% FS::sched_avail::pretty_time($t) %>
10 %     }
11     </SELECT>
12 % }
13 <%init>
14
15 my %opt = @_;
16 my $increment = $opt{increment} || 30;
17 my $selected_default = $opt{selected_default};
18 my $disabled = $opt{'disabled'} || '';
19
20 my $curr_value = $opt{curr_value};
21
22 my $onchange = '';
23 if ( $opt{'onchange'} ) {
24   $onchange = $opt{'onchange'};
25   $onchange .= '(this)' unless $onchange =~ /\(\w*\);?$/;
26   $onchange =~ s/\(what\);/\(this\);/g; #ugh, terrible hack.  all onchange
27                                         #callbacks should act the same
28   $onchange = 'onChange="'. $onchange. '"' unless $onchange =~ /^onChange=/i;
29 }
30
31 </%init>