diff options
| author | Ivan Kohler <ivan@freeside.biz> | 2012-07-08 22:45:58 -0700 |
|---|---|---|
| committer | Ivan Kohler <ivan@freeside.biz> | 2012-07-08 22:45:58 -0700 |
| commit | a6fe07e49e3fc12169e801b1ed6874c3a5bd8500 (patch) | |
| tree | b87a7e6f37da5c8e13eb4d4653cfc8ce9239d8f0 /httemplate/elements/select-table.html | |
| parent | e27244386c346f459d1569db26344407a0372a05 (diff) | |
| parent | 005424d0c899aa899f43f583a6c74deb13ea4be1 (diff) | |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Conflicts:
httemplate/misc/process/cancel_pkg.html
Diffstat (limited to 'httemplate/elements/select-table.html')
| -rw-r--r-- | httemplate/elements/select-table.html | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/httemplate/elements/select-table.html b/httemplate/elements/select-table.html index c0dde7414..127028ee5 100644 --- a/httemplate/elements/select-table.html +++ b/httemplate/elements/select-table.html @@ -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 +% } <OPTION VALUE="<% $recvalue %>" - <% $opt{'all_selected'} || ref($value) && $value->{$recvalue} || $value && $value eq $recvalue # not == because of value_col - ? ' SELECTED' : '' - %> + <% $selected ? ' SELECTED' : '' %> % foreach my $att ( @{ $opt{'extra_option_attributes'} } ) { data-<% $att %>="<% $record->$att() |h %>" % } |
