From 167a699ce4eaa68a56cd8d38a79696840ef46679 Mon Sep 17 00:00:00 2001 From: Christopher Burger Date: Tue, 19 Feb 2019 14:42:25 -0500 Subject: RT# 82092 - custom fields now save and fixed so name label is displayed insted of actual field name --- httemplate/edit/process/cust_main.cgi | 5 +++++ httemplate/edit/process/part_virtual_field.html | 3 +++ 2 files changed, 8 insertions(+) (limited to 'httemplate/edit/process') diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi index e1a5bc6e2..baacd5e7e 100755 --- a/httemplate/edit/process/cust_main.cgi +++ b/httemplate/edit/process/cust_main.cgi @@ -97,6 +97,11 @@ my $new = new FS::cust_main ( { (map { ( "ship_$_", '' ) } (FS::cust_main->location_fields)) } ); +# add any virtual fields to the new cust_main record +foreach ($new->virtual_fields) { + $new->setfield($_, scalar($cgi->param($_))); +} + warn Dumper( $new ) if $DEBUG > 1; if ( $duplicate_of ) { diff --git a/httemplate/edit/process/part_virtual_field.html b/httemplate/edit/process/part_virtual_field.html index e734d9616..6a8008db7 100644 --- a/httemplate/edit/process/part_virtual_field.html +++ b/httemplate/edit/process/part_virtual_field.html @@ -42,6 +42,9 @@ my $act = 'add'; +## make cgi->param("name") lowercase +$cgi->param('name' => lc $cgi->param('name')); + die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); -- cgit v1.2.1