X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fconfig%2Fconfig-process.cgi;h=788d9016e91006d7f205bc5bb5f362c865bab561;hb=7b125e587a4d1ee0aca692e23ea7897f671855ae;hp=84bfdefcb84165350cc26efd0ee33c152c72ecad;hpb=a4b8ce8cd1d309de00c64f38049a8dda38798046;p=freeside.git diff --git a/httemplate/config/config-process.cgi b/httemplate/config/config-process.cgi index 84bfdefcb..788d9016e 100644 --- a/httemplate/config/config-process.cgi +++ b/httemplate/config/config-process.cgi @@ -1,3 +1,74 @@ +<% header('Configuration set') %> + + + +<%once> +#false laziness w/config-view.cgi +my %namecol = ( + 'part_svc' => 'svc', + 'part_pkg' => 'pkg', + 'pkg_class' => 'classname', +); + <%init> die "access denied\n" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); @@ -41,15 +112,19 @@ foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { } else { push @delete, $i->key; } - } elsif ( $type eq 'text' || $type eq 'select' || $type eq 'select-sub' ) { - if ( $cgi->param($i->key.$n) ne '' ) { - $conf->set($i->key, $cgi->param($i->key.$n), $agentnum); + } elsif ( + $type =~ /^(editlist|selectmultiple)$/ + or ( $type =~ /^select(-(sub|part_svc|part_pkg|pkg_class))?$/ + || $i->multiple ) + ) { + if ( scalar(@{[ $cgi->param($i->key.$n) ]}) ) { + $conf->set($i->key, join("\n", @{[ $cgi->param($i->key.$n) ]} ), $agentnum); } else { $conf->delete($i->key, $agentnum); } - } elsif ( $type eq 'editlist' || $type eq 'selectmultiple' ) { - if ( scalar(@{[ $cgi->param($i->key.$n) ]}) ) { - $conf->set($i->key, join("\n", @{[ $cgi->param($i->key.$n) ]} ), $agentnum); + } elsif ( $type =~ /^(text|select(-(sub|part_svc|part_pkg|pkg_class))?)$/ ) { + if ( $cgi->param($i->key.$n) ne '' ) { + $conf->set($i->key, $cgi->param($i->key.$n), $agentnum); } else { $conf->delete($i->key, $agentnum); } @@ -61,45 +136,3 @@ $conf->touch($_, $agentnum) foreach @touch; $conf->delete($_, $agentnum) foreach @delete; -<% header('Configuration set') %> - -