X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fselect-table.html;h=42e91f00c065d2e1b5619218ea1d6b79314e37d0;hb=c6782ab85ea83e0c78d85b8975985aac9d467f9d;hp=772f0c6535f1c2615de57483bbfd1c6d8714c59e;hpb=5b29227d64e62b6f056c4bcec0a3e0a82269a3e5;p=freeside.git diff --git a/httemplate/elements/select-table.html b/httemplate/elements/select-table.html index 772f0c653..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 +% }