<% include("/elements/header-popup.html", $title) %> % if ( $cgi->param('error') ) { Error: <% $cgi->param('error') %>

% }
Setting <% $key %> % if ( defined $config_item->editlist_parts ) { % my $pnum=0; % foreach my $part ( @{$config_item->editlist_parts} ) { % $pnum++; % } % } else { % }
% my $n = 0; % foreach my $type ( ref($config_item->type) ? @{$config_item->type} : $config_item->type ) { % if ( $type eq '' ) { no type % } elsif ( $type eq 'binary' ) { Filename "> % } elsif ( $type eq 'textarea' ) { % } elsif ( $type eq 'checkbox' ) { " type="checkbox" value="1" <% $conf->exists($key, $agentnum) ? 'CHECKED' : '' %> > % } elsif ( $type eq 'text' ) { " type="text" value="<% $conf->exists($key, $agentnum) ? $conf->config($key, $agentnum) : '' %>"> % } elsif ( $type eq 'select' || $type eq 'selectmultiple' ) { % } elsif ( $type eq 'select-sub' ) { % } elsif ( $type eq 'editlist' ) { %
()">
<% itable() %>
% if ( $part->{type} eq 'text' ) { "> % } elsif ( $part->{type} eq 'immutable' ) { <% $part->{value} %> " value="<% $part->{value} %>"> % } elsif ( $part->{type} eq 'select' ) { % } else { unknown type <% $part->type %> % } >(this.form)">
% } else { unknown type $type % } % $n++; % } <% $description %>
<%once> my $conf = new FS::Conf; my %confitems = map { $_->key => $_ } $conf->config_items; <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); my($agentnum, $agent, $title, $action, $key, $value, $config_item, $description, $type); $action = 'Set'; if ($cgi->param('agentnum') =~ /(\d+)$/) { $agentnum=$1; } if ($agentnum) { $agent = qsearchs('agent', { 'agentnum' => $1 } ); die "Agent $agentnum not found!" unless $agent; $title = "$action configuration override for ". $agent->agent; } else { $title = "$action global configuration"; } $cgi->param('key') =~ /^([-.\w]+)$/ or die "illegal configuration item"; $key=$1; $value = $conf->config($key); $config_item = $confitems{$key}; $description = $config_item->description; $type = $config_item->type;