diff options
Diffstat (limited to 'httemplate/edit/part_svc.cgi')
-rwxr-xr-x | httemplate/edit/part_svc.cgi | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 6fe015a..940ea8d 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -291,12 +291,22 @@ that field. % (grep(/^$rvalue$/, split(',',$value)) ? ' SELECTED>' : '>' ). % $record->$select_label(). '</OPTION>'; % } #next $record -% } else { # select_list +% } elsif ( $def->{select_list} ) { % foreach my $item ( @{$def->{select_list}} ) { % $html .= qq!<OPTION VALUE="$item"!. % (grep(/^$item$/, split(',',$value)) ? ' SELECTED>' : '>' ). % $item. '</OPTION>'; % } #next $item +% } elsif ( $def->{select_hash} ) { +% if ( ref($def->{select_hash}) eq 'ARRAY' ) { +% tie my %hash, 'Tie::IxHash', @{ $def->{select_hash} }; +% $def->{select_hash} = \%hash; +% } +% foreach my $key ( keys %{$def->{select_hash}} ) { +% $html .= qq!<OPTION VALUE="$key"!. +% (grep(/^$key$/, split(',',$value)) ? ' SELECTED>' : '>' ). +% $def->{select_hash}{$key}. '</OPTION>'; +% } #next $key % } #endif % $html .= '</SELECT>'; % |