X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fconfig%2Fconfig-process.cgi;h=d84edce0043f270b36263c71360041c722a1dee6;hp=3dcb1d3ef8be8ba0a753a62f1583d65f52bfb4c9;hb=35d34f06298d62aac3d4d9a2b486a2759d6d4952;hpb=5561143b7d2e7e153302017e1d3ecdf7caa7dba8 diff --git a/httemplate/config/config-process.cgi b/httemplate/config/config-process.cgi index 3dcb1d3ef..d84edce00 100644 --- a/httemplate/config/config-process.cgi +++ b/httemplate/config/config-process.cgi @@ -47,7 +47,7 @@ ''; % } elsif ( $type eq 'checkbox' ) { -% if ( $conf->exists($i->key, $agentnum) ) { +% if ( $conf->config_bool($i->key, $agentnum) ) { configCell.style.backgroundColor = '#00ff00'; configCell.innerHTML = 'YES'; % } else { @@ -75,7 +75,7 @@ configCell.innerHTML = <% $value |js_string %>; % } elsif ( $type eq 'select-sub' && ! $i->multiple ) { configCell.innerHTML = - <% $conf->config($i->key, $agentnum) |js_string %> + ': ' + + <% $conf->exists($i->key, $agentnum) ? $conf->config($i->key, $agentnum) : '' |js_string %> + ': ' + <% &{ $i->option_sub }( $conf->config($i->key, $agentnum) ) |js_string %>; % } else { //alert('unknown type <% $type %>'); @@ -116,7 +116,7 @@ if ( $conf->exists('disable_settings_changes') ) { } } -$FS::Conf::DEBUG = 1; +#$FS::Conf::DEBUG = 1; my @config_items = grep { $_->key != ~/^invoice_(html|latex|template)/ } $conf->config_items; my %confitems = map { $_->key => $_ } $conf->config_items; @@ -164,7 +164,7 @@ foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { or ( $type =~ /^select(-(sub|part_svc|part_pkg|pkg_class|agent))?$/ || $i->multiple ) ) { - if ( scalar(@{[ $cgi->param($i->key.$n) ]}) ) { + if ( scalar(@{[ $cgi->param($i->key.$n) ]}) && $cgi->param($i->key.$n) ne '' ) { my $error = &{$i->validate}([ $cgi->param($i->key.$n) ], $n) if $i->validate; push @error, $error if $error; $conf->set($i->key, join("\n", @{[ $cgi->param($i->key.$n) ]} ), $agentnum); @@ -184,7 +184,7 @@ foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { } # warn @touch; $conf->touch($_, $agentnum) foreach @touch; -$conf->delete($_, $agentnum) foreach @delete; +$conf->delete_bool($_, $agentnum) foreach @delete; if (scalar(@error)) { $cgi->param('error', join(' ', @error));