diff options
author | ivan <ivan> | 2004-08-19 10:56:42 +0000 |
---|---|---|
committer | ivan <ivan> | 2004-08-19 10:56:42 +0000 |
commit | 4d9d7b07924ceb7386c0b5fc40e2ebc535bf3e4b (patch) | |
tree | 55efc62173838e65864a19802b17fa83f930b449 | |
parent | c174d97e14dcd23153587ab0b97e082b5b1af619 (diff) |
backport select_list changes from 1.5 so the fix for #118 works in 1.4 branch too
-rwxr-xr-x | httemplate/edit/part_svc.cgi | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 643c414c1..ce8c463b7 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -209,12 +209,20 @@ my %defs = ( if ( $def->{type} eq 'select' ) { $html .= qq!<SELECT NAME="${layer}__${field}">!; $html .= '<OPTION> </OPTION>' unless $value; - foreach my $record ( qsearch( $def->{select_table}, {} ) ) { - my $rvalue = $record->getfield($def->{select_key}); - $html .= qq!<OPTION VALUE="$rvalue"!. - ( $rvalue==$value ? ' SELECTED>' : '>' ). - $record->getfield($def->{select_label}). '</OPTION>'; - } + if ( $def->{select_table} ) { + foreach my $record ( qsearch( $def->{select_table}, {} ) ) { + my $rvalue = $record->getfield($def->{select_key}); + $html .= qq!<OPTION VALUE="$rvalue"!. + ( $rvalue==$value ? ' SELECTED>' : '>' ). + $record->getfield($def->{select_label}). '</OPTION>'; + } #next $record + } else { # select_list + foreach my $item ( @{$def->{select_list}} ) { + $html .= qq!<OPTION VALUE="$item"!. + ( $item eq $value ? ' SELECTED>' : '>' ). + $item. '</OPTION>'; + } #next $item + } #endif $html .= '</SELECT>'; } elsif ( $def->{type} eq 'radius_usergroup_selector' ) { $html .= FS::svc_acct::radius_usergroup_selector( |