X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fselect-table.html;h=42e91f00c065d2e1b5619218ea1d6b79314e37d0;hb=c6782ab85ea83e0c78d85b8975985aac9d467f9d;hp=c0dde74147eb1df67743b574f610326942c73c52;hpb=d838063ab25f047e88c3e5ae16f77fc4f3481ce9;p=freeside.git diff --git a/httemplate/elements/select-table.html b/httemplate/elements/select-table.html index c0dde7414..42e91f00c 100644 --- a/httemplate/elements/select-table.html +++ b/httemplate/elements/select-table.html @@ -8,7 +8,7 @@ Example: # required ## 'table' => 'table_name', - 'name_col' => 'name_column', + 'name_col' => 'name_column', #or method if you pass an order_by #strongly recommended (you want your forms to be "sticky" on errors, right?) 'curr_value' => 'current_value', @@ -93,10 +93,17 @@ Example: % ) % { % my $recvalue = $record->$key(); +% my $selected; +% if ( $opt{'all_selected'} ) { +% $selected = 1; +% } elsif ( $opt{'compare_sub'} && !ref($value) ) { +% $selected = &{ $opt{'compare_sub'} }( $value, $recvalue ); +% } else { +% $selected = ( ref($value) && $value->{$recvalue} ) +% || ( $value && $value eq $recvalue ); #not == because of value_col +% }