X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fcheckboxes-table.html;h=d3bbab430ebd08f5204694cdccde692e7aa068f6;hp=a31bdb91953ef1317b6a0aef2a1ca785ce9811c6;hb=64aec88c35418b8c630811cdf5afb19b2a1c4299;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c diff --git a/httemplate/elements/checkboxes-table.html b/httemplate/elements/checkboxes-table.html index a31bdb919..d3bbab430 100644 --- a/httemplate/elements/checkboxes-table.html +++ b/httemplate/elements/checkboxes-table.html @@ -69,6 +69,7 @@ % 'select' => $opt{'target_table'}. '.*', % 'addl_from' => "LEFT JOIN $opt{'link_table'} USING ( $target_pkey )", % 'extra_sql' => $extra_sql, +% 'order_by' => $opt{'order_by'}, % }) % ) { % @@ -81,6 +82,14 @@ % ? 'CHECKED' % : ''; % +% } elsif ( !$sourcenum ) { # newly created object, has no links yet +% +% if ( ref($opt{'default'}) ) { +% $checked = $opt{'default'}->{$targetnum} ? 'CHECKED' : ''; +% } else { +% $checked = $opt{'default'} ? 'CHECKED' : '' +% } +% % } else { % % $checked = qsearchs( $opt{'link_table'}, { @@ -94,17 +103,12 @@ % % - - VALUE="ON"> +% my $color_col = $opt{'color_col'}; + VALUE="ON">
% if ( $opt{'target_link'} ) { - - -% -% % } % -<% $targetnum %>: % if ( $opt{'name_callback'} ) { @@ -114,7 +118,7 @@ % - <% $target_obj->$name_col() %><% $opt{'target_link'} ? '' : '' %> + <% $target_obj->$name_col() %>
<% $opt{'target_link'} ? '' : '' %> % } % if ( $opt{'disable-able'} ) {