freeside/httemplate/edit part_svc.cgi,1.27.4.6,1.27.4.7

ivan ivan at pouncequick.420.am
Thu Aug 19 03:56:44 PDT 2004


Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory pouncequick:/tmp/cvs-serv29790

Modified Files:
      Tag: FREESIDE_1_4_BRANCH
	part_svc.cgi 
Log Message:
backport select_list changes from 1.5 so the fix for #118 works in 1.4 branch too

Index: part_svc.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/part_svc.cgi,v
retrieving revision 1.27.4.6
retrieving revision 1.27.4.7
diff -u -d -r1.27.4.6 -r1.27.4.7
--- part_svc.cgi	19 Aug 2004 10:53:33 -0000	1.27.4.6
+++ part_svc.cgi	19 Aug 2004 10:56:42 -0000	1.27.4.7
@@ -209,12 +209,20 @@
           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(




More information about the freeside-commits mailing list