X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fsvc_domain.cgi;h=a5c617d8390be408c45d8adc4b203d96fbbd3941;hb=b71b1576c68bc40ad26592b354feace37a029f0e;hp=ea97918e8360543bd274f34d710d5daa288db6f9;hpb=be61853021954c3cf8f6e63a41b1fa693e3af6d8;p=freeside.git diff --git a/httemplate/edit/process/svc_domain.cgi b/httemplate/edit/process/svc_domain.cgi index ea97918e8..a5c617d83 100755 --- a/httemplate/edit/process/svc_domain.cgi +++ b/httemplate/edit/process/svc_domain.cgi @@ -27,6 +27,18 @@ unless ( $cgi->param('cgp_accessmodes') ) { ); } +#unmunge acct_def_cgp_accessmodes (falze laziness-ahoy) +unless ( $cgi->param('acct_def_cgp_accessmodes') ) { + $cgi->param('acct_def_cgp_accessmodes', + join(' ', + sort map { /^acct_def_cgp_accessmodes_([\w\/]+)$/ or die "no way"; $1; } + grep $cgi->param($_), + grep /^acct_def_cgp_accessmodes_([\w\/]+)$/, + $cgi->param() + ) + ); +} + my $new = new FS::svc_domain ( { map { $_, scalar($cgi->param($_)); @@ -34,6 +46,11 @@ my $new = new FS::svc_domain ( { } ( fields('svc_domain'), qw( pkgnum svcpart action ) ) } ); +# trim leading and trailing whitespace to avoid errors caused by pasting into UI +my $domain = $new->domain; +$domain =~ s/^\s+|\s+$//g; +$new->domain($domain); + my $error = ''; if ($cgi->param('svcnum')) { $error = $new->replace();