1 <% include("/elements/header.html",
4 'View all agents' => $p.'browse/agent.cgi',
9 Click on a configuration value to change it.
12 <% include('/elements/init_overlib.html') %>
14 % if ($FS::UID::use_confcompat) {
15 <FONT SIZE="+1" COLOR="#ff0000">CONFIGURATION NOT STORED IN DATABASE -- USING COMPATIBILITY MODE</FONT><BR><BR>
18 % foreach my $section ( qw(required billing username password UI session
23 <A NAME="<% $section || 'unclassified' %>"></A>
25 % foreach my $nav_section ( qw(required billing username password UI session
29 % if ( $section eq $nav_section ) {
31 [<A NAME="not<% $nav_section || 'unclassified' %>" style="background-color: #cccccc"><% ucfirst($nav_section || 'unclassified') %></A>]
34 [<A HREF="#<% $nav_section || 'unclassified' %>"><% ucfirst($nav_section || 'unclassified') %></A>]
39 <TABLE BGCOLOR="#cccccc" BORDER=1 CELLSPACING=0 CELLPADDING=0 BORDERCOLOR="#999999">
41 <th colspan="2" bgcolor="#dcdcdc">
42 <% ucfirst($section || 'unclassified') %> configuration options
45 % foreach my $i (grep $_->section eq $section, @config_items) {
46 % my @types = ref($i->type) ? @{$i->type} : ($i->type);
47 % my( $width, $height ) = ( 522, 336 );
48 % if ( grep $_ eq 'textarea', @types ) {
58 <td><% include('/elements/popup_link.html',
59 'action' => 'config.cgi?key='. $i->key.
60 ';agentnum='. $agentnum,
63 'actionlabel' => 'Enter configuration value',
64 'label' => '<b>'. $i->key. '</b>',
67 %>: <% $i->description %>
72 % foreach my $type (@types) {
74 % if ( $type eq '' ) {
77 <td><font color="#ff0000">no type</font></td>
79 % } elsif ( $type eq 'binary' ) {
82 <% $conf->exists($i->key, $agentnum)
83 ? qq!<a href="config-download.cgi?key=!. $i->key. ';agentnum='. $agentnum. qq!">download</a>!
88 % } elsif ( $type eq 'textarea'
89 % || $type eq 'editlist'
90 % || $type eq 'selectmultiple' ) {
93 <td id="<% $i->key.$n %>" bgcolor="#ffffff">
95 <% encode_entities(join("\n",
96 map { length($_) > 88 ? substr($_,0,88).'...' : $_ }
97 $conf->config($i->key, $agentnum)
103 % } elsif ( $type eq 'checkbox' ) {
106 <td id="<% $i->key.$n %>" bgcolor="#<% $conf->exists($i->key, $agentnum) ? '00ff00">YES' : 'ff0000">NO' %></td>
108 % } elsif ( $type eq 'text' || $type eq 'select' ) {
111 <td id="<% $i->key.$n %>" bgcolor="#ffffff">
112 <% $conf->exists($i->key, $agentnum) ? $conf->config($i->key, $agentnum) : '' %>
114 % } elsif ( $type eq 'select-sub' ) {
117 <td id="<% $i->key.$n %>" bgcolor="#ffffff">
118 <% $conf->config($i->key, $agentnum) %>:
119 <% &{ $i->option_sub }( $conf->config($i->key, $agentnum) ) %>
125 <font color="#ff0000">unknown type <% $type %></font>
143 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
146 if ($cgi->param('agentnum') =~ /^(\d+)$/) {
152 my $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
153 die "Agent $agentnum not found!" unless $agent;
155 $title = "Configuration for ". $agent->agent;
157 $title = 'Global Configuration';
160 my $conf = new FS::Conf;
162 my @config_items = grep { $agentnum ? $_->per_agent : 1 }
163 grep { $_->key != ~/^invoice_(html|latex|template)/ }