invoice_sections_with_taxes per-agent, RT#79636
[freeside.git] / httemplate / elements / tr-checkbox.html
index 2e6d1f1..ed16650 100644 (file)
@@ -1,16 +1,34 @@
-<% include('tr-td-label.html', @_ ) %>
+<%doc>
 
-  <TD <% $style %>>
-    <INPUT TYPE  = "checkbox"
-           NAME  = "<% $opt{field} %>"
-           ID    = "<% $opt{id} %>"
-           VALUE = "<% $opt{value} %>"
-           <% $opt{curr_value} eq $opt{value} ? ' CHECKED' : '' %>
-           <% $onchange %>
+Example:
+
+  <& /elements/tr-checkbox.html,
+       'label' => 'Do or do not',
+       'field' => 'field_name',
+       'value' => 'Y',
+  &>
+
+</%doc>
+% if ( $opt{'box_first'} ) {
+  <TR>
+    <TH COLSPAN="<% $opt{'colspan'} || 2 %>"
+      VALIGN = "<% $opt{'valign'} || 'top' %>"
+      STYLE  = "<% $style %>"
+      ID     = "<% $opt{label_id} || $opt{id}. '_label0' %>"
     >
+      <& checkbox.html, @_ &>
+      <% $required %><% $opt{label} %>
+    </TH>
+  </TR>
+% } else {
+<& tr-td-label.html, @_ &>
+
+  <TD <% $style %>>
+    <% include('checkbox.html', @_) %>
   </TD>
 
 </TR>
+% }
 
 <%init>
 
@@ -20,6 +38,12 @@ my $onchange = $opt{'onchange'}
                  ? 'onChange="'. $opt{'onchange'}. '(this)"'
                  : '';
 
-my $style = $opt{'cell_style'} ? 'STYLE="'. $opt{'cell_style'}. '"' : '';
+my $style = 'text-align: left; padding-top: 3px';
+$style .= '; '. $opt{'cell_style'} if $opt{'cell_style'};
+
+my $required = $opt{'required'} ? '<font color="#ff0000">*</font>&nbsp;' : '';
+if ($required) {
+  $style .= ';font-weight: bold';
+}
 
 </%init>