X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_virtual_field.pm;h=eae519f6d561f1f1f51dfed37e3370b00b2157be;hp=4e6d2e4bd07c9793468105322c7d21f06f3362a0;hb=5372897f367498972c96f5494e142e6e11b29eb8;hpb=c405e80203f323a83b447d6fc899dbba32d52f2a diff --git a/FS/FS/part_virtual_field.pm b/FS/FS/part_virtual_field.pm index 4e6d2e4bd..eae519f6d 100755 --- a/FS/FS/part_virtual_field.pm +++ b/FS/FS/part_virtual_field.pm @@ -1,12 +1,9 @@ package FS::part_virtual_field; +use base qw(FS::Record); use strict; -use vars qw( @ISA ); -use FS::Record; +use HTML::Entities; use FS::Schema qw( dbdef ); -use CGI qw(escapeHTML); - -@ISA = qw( FS::Record ); =head1 NAME @@ -62,6 +59,7 @@ Create a new record. To add the record to the database, see "insert". sub table { 'part_virtual_field'; } sub virtual_fields { () } +sub virtual_fields_hash { () } =item widget UI_TYPE MODE [ VALUE ] @@ -84,20 +82,21 @@ VALUE (optional) is the current value of the field. sub widget { my $self = shift; - my ($ui_type, $mode, $value) = @_; + my ($ui_type, $mode, $value, $header_col_type) = @_; + $header_col_type = 'TD' unless $header_col_type; my $text; my $label = $self->label || $self->name; if ($ui_type eq 'HTML') { if ($mode eq 'view') { - $text = q!! . $label . - q!! . $value . + $text = q!! . encode_entities($label) . + q!! . encode_entities($value) . q!! . "\n"; } elsif ($mode eq 'edit') { - $text = q!! . $label . - q!!; - $text .= q!! . encode_entities($label) . + q!!; + $text .= q!length) { $text .= q! SIZE="! . $self->length . q!"!; }