diff options
author | Christopher Burger <burgerc@freeside.biz> | 2019-02-19 14:42:25 -0500 |
---|---|---|
committer | Christopher Burger <burgerc@freeside.biz> | 2019-02-19 14:42:25 -0500 |
commit | a7a22257d456394125eed32f8261c75a7f393ec2 (patch) | |
tree | 444e0a4e3594952c1ddb9212e65dd061b5f4866f /FS/FS/part_virtual_field.pm | |
parent | 772656864b377bbd2ef2febd40891ef1206b5be0 (diff) |
RT# 82092 - custom fields now save and fixed so name label is displayed insted of actual field name
Diffstat (limited to 'FS/FS/part_virtual_field.pm')
-rwxr-xr-x | FS/FS/part_virtual_field.pm | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/FS/FS/part_virtual_field.pm b/FS/FS/part_virtual_field.pm index 0011ec6..63712b7 100755 --- a/FS/FS/part_virtual_field.pm +++ b/FS/FS/part_virtual_field.pm @@ -59,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 ] @@ -81,19 +82,20 @@ 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!<TR><TD ALIGN="right">! . $label . - q!</TD><TD BGCOLOR="#ffffff">! . $value . + $text = q!<TR><!.$header_col_type.q! ALIGN="right">! . $label . + q!</!.$header_col_type.q!><TD BGCOLOR="#ffffff">! . $value . q!</TD></TR>! . "\n"; } elsif ($mode eq 'edit') { - $text = q!<TR><TD ALIGN="right">! . $label . - q!</TD><TD>!; - $text .= q!<INPUT NAME="! . $self->name . + $text = q!<TR><!.$header_col_type.q! ALIGN="right">! . $label . + q!</!.$header_col_type.q!><TD>!; + $text .= q!<INPUT TYPE=text NAME="! . $self->name . q!" VALUE="! . escapeHTML($value) . q!"!; if ($self->length) { $text .= q! SIZE="! . $self->length . q!"!; |