X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_virtual_field.pm;h=e54dc9389e6721e97a33729f218b36184a151445;hb=83cad295d38b0c764b59b62bc4840dcf666b7de9;hp=4e6d2e4bd07c9793468105322c7d21f06f3362a0;hpb=c405e80203f323a83b447d6fc899dbba32d52f2a;p=freeside.git diff --git a/FS/FS/part_virtual_field.pm b/FS/FS/part_virtual_field.pm index 4e6d2e4bd..e54dc9389 100755 --- a/FS/FS/part_virtual_field.pm +++ b/FS/FS/part_virtual_field.pm @@ -4,7 +4,7 @@ use strict; use vars qw( @ISA ); use FS::Record; use FS::Schema qw( dbdef ); -use CGI qw(escapeHTML); +use HTML::Entities; @ISA = qw( FS::Record ); @@ -62,6 +62,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 +85,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!"!; }