X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fconfig%2Fconfig-process.cgi;h=788d9016e91006d7f205bc5bb5f362c865bab561;hb=7b125e587a4d1ee0aca692e23ea7897f671855ae;hp=b0c8a745681016861fc1971719e31af4e14ba6ee;hpb=c648976f0b7975f2328ebd7ba8c711fad0ca4195;p=freeside.git diff --git a/httemplate/config/config-process.cgi b/httemplate/config/config-process.cgi index b0c8a7456..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'); @@ -25,7 +96,7 @@ foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { } else { $conf->delete($i->key, $agentnum); } - } elsif ( $type eq 'binary' ) { + } elsif ( $type eq 'binary' || $type eq 'image' ) { if ( defined($cgi->param($i->key.$n)) && $cgi->param($i->key.$n) ) { my $fh = $cgi->upload($i->key.$n); if (defined($fh)) { @@ -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,8 +136,3 @@ $conf->touch($_, $agentnum) foreach @touch; $conf->delete($_, $agentnum) foreach @delete; -<% header('Configuration set') %> - -