From ba5975d05c4bf88a47750fecf8651821460ab30f Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 16 Jun 2011 20:21:41 +0000 Subject: add default_agentnum config, RT#13302 --- httemplate/config/config-process.cgi | 7 ++++--- httemplate/config/config-view.cgi | 3 ++- httemplate/config/config.cgi | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) (limited to 'httemplate/config') diff --git a/httemplate/config/config-process.cgi b/httemplate/config/config-process.cgi index 4e1c85a03..4a84c0dd1 100644 --- a/httemplate/config/config-process.cgi +++ b/httemplate/config/config-process.cgi @@ -65,7 +65,7 @@ % } elsif ( $type eq 'text' || $type eq 'select' ) { configCell.innerHTML = <% $conf->exists($i->key, $agentnum) ? $conf->config($i->key, $agentnum) : '' |js_string %>; -% } elsif ( $type =~ /^select-(part_svc|part_pkg|pkg_class)$/ && ! $i->multiple ) { +% } elsif ( $type =~ /^select-(part_svc|part_pkg|pkg_class|agent)$/ && ! $i->multiple ) { % my $table = $1; % my $namecol = $namecol{$table}; % my $pkey = dbdef->table($table)->primary_key; @@ -95,6 +95,7 @@ my %namecol = ( 'part_svc' => 'svc', 'part_pkg' => 'pkg', 'pkg_class' => 'classname', + 'agent' => 'agent', ); <%init> @@ -158,7 +159,7 @@ foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { } } elsif ( $type =~ /^(editlist|selectmultiple)$/ - or ( $type =~ /^select(-(sub|part_svc|part_pkg|pkg_class))?$/ + or ( $type =~ /^select(-(sub|part_svc|part_pkg|pkg_class|agent))?$/ || $i->multiple ) ) { if ( scalar(@{[ $cgi->param($i->key.$n) ]}) ) { @@ -168,7 +169,7 @@ foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { } else { $conf->delete($i->key, $agentnum); } - } elsif ( $type =~ /^(text|select(-(sub|part_svc|part_pkg|pkg_class))?)$/ ) { + } elsif ( $type =~ /^(text|select(-(sub|part_svc|part_pkg|pkg_class|agent))?)$/ ) { if ( $cgi->param($i->key.$n) ne '' ) { my $error = &{$i->validate}($cgi->param($i->key.$n), $n) if $i->validate; push @error, $error if $error; diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi index 7516dabab..10fcde3c4 100644 --- a/httemplate/config/config-view.cgi +++ b/httemplate/config/config-view.cgi @@ -212,7 +212,7 @@ Click on a configuration value to change it. -% } elsif ( $type =~ /^select-(part_svc|part_pkg|pkg_class)$/ ) { +% } elsif ( $type =~ /^select-(part_svc|part_pkg|pkg_class|agent)$/ ) { % % my $table = $1; % my $namecol = $namecol{$table}; @@ -318,6 +318,7 @@ my %namecol = ( 'part_svc' => 'svc', 'part_pkg' => 'pkg', 'pkg_class' => 'classname', + 'agent' => 'agent', ); <%init> diff --git a/httemplate/config/config.cgi b/httemplate/config/config.cgi index cde48382a..040ed0403 100644 --- a/httemplate/config/config.cgi +++ b/httemplate/config/config.cgi @@ -323,7 +323,7 @@ my @config_items = $conf->config_items; my %confitems = map { $_->key => $_ } @config_items; my %element_types = map { $_ => 1 } qw( - select-part_svc select-part_pkg select-pkg_class + select-part_svc select-part_pkg select-pkg_class select-agent ); -- cgit v1.2.1