X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fselect-cust-fields.html;h=63e92ac3dad8bb4cbd7f92a1a06e19fbac94b597;hp=98feaf85c24505400d45490163ed9620569243c3;hb=5b9562f8e03ae6efea0c2eaa90341083744fa529;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c diff --git a/httemplate/elements/select-cust-fields.html b/httemplate/elements/select-cust-fields.html index 98feaf85c..63e92ac3d 100644 --- a/httemplate/elements/select-cust-fields.html +++ b/httemplate/elements/select-cust-fields.html @@ -1,22 +1,24 @@ -% -% my( $cust_fields, %opt ) = @_; -% -% use FS::ConfDefaults; -% $opt{'avail_fields'} ||= [ FS::ConfDefaults->cust_fields_avail() ]; -% -% tie my %hash, 'Tie::IxHash', @{ $opt{'avail_fields'} }; -% -% +<%init> + my( $cust_fields, %opt ) = @_; + my @fields = FS::ConfDefaults->cust_fields_avail(); + my $contact_phone_list; + foreach my $phone_type ( FS::phone_type->get_phone_types() ) { + $contact_phone_list .= " | Contact ".$phone_type->typename." phone(s)"; + } + @fields = map {s/\| Contact phone\(s\)/$contact_phone_list/g; $_; } @fields; + + $opt{'avail_fields'} ||= [ @fields ]; + + tie my %hash, 'Tie::IxHash', @{ $opt{'avail_fields'} }; +