stray closing /TABLE in the no-ticket case
[freeside.git] / httemplate / elements / tr-select-avail-time-from_to.html
1 % unless ( $opt{'js_only'} ) {
2
3     <& tr-td-label.html, %opt &>
4
5       <TD <% $colspan %> <% $style %>>
6 % }
7     <& checkbox.html,
8          %opt,
9          prefix     => '',
10          value      => 'Y',
11          curr_value => $curr_value,
12          onchange   => $opt{field}. '_changed',
13     &>
14
15     <& select-time-from_to.html,
16          %opt,
17          disabled => ($curr_value eq 'Y' ? '' : 'DISABLED' )
18     &>
19
20 % unless ( $opt{'js_only'} ) {
21       </TD>
22     </TR>
23 % }
24 % unless ( $opt{'html_only'} || $opt{'js_only'} ) {
25     <SCRIPT TYPE="text/javascript">
26 % }
27 % unless ( $opt{'html_only'} ) {
28       function <% $opt{field} %>_changed(what) {
29
30         <% $opt{'onchange'} %>
31
32         var stime_el = what.form.<% $opt{field} %>_stime;
33         var etime_el = what.form.<% $opt{field} %>_etime;
34
35         if ( what.checked ) {
36           stime_el.disabled = false;
37           etime_el.disabled = false;
38         } else {
39           stime_el.disabled = true;
40           etime_el.disabled = true;
41         }
42
43       }  
44 % }
45 % unless ( $opt{'html_only'} || $opt{'js_only'} ) {
46     </SCRIPT>
47 % }
48 <%init>
49
50 my %opt = @_;
51
52 my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';
53
54 my $colspan = $opt{'colspan'} ? 'COLSPAN="'.$opt{'colspan'}.'"' : '';
55
56 my $curr_value = $cgi->param($opt{'field'}); #wtf?
57
58 </%init>