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) {
16 <FONT SIZE="+1" COLOR="#ff0000">CONFIGURATION NOT STORED IN DATABASE -- USING COMPATIBILITY MODE</FONT><BR><BR>
19 % foreach my $section ( qw(required billing username password UI session
24 <A NAME="<% $section || 'unclassified' %>"></A>
26 % foreach my $nav_section ( qw(required billing username password UI session
30 % if ( $section eq $nav_section ) {
32 [<A NAME="not<% $nav_section || 'unclassified' %>" style="background-color: #cccccc"><% ucfirst($nav_section || 'unclassified') %></A>]
35 [<A HREF="#<% $nav_section || 'unclassified' %>"><% ucfirst($nav_section || 'unclassified') %></A>]
40 <TABLE BGCOLOR="#cccccc" BORDER=1 CELLSPACING=0 CELLPADDING=0 BORDERCOLOR="#999999">
42 <th colspan="2" bgcolor="#dcdcdc">
43 <% ucfirst($section || 'unclassified') %> configuration options
46 % foreach my $i (grep $_->section eq $section, @config_items) {
47 % my @types = ref($i->type) ? @{$i->type} : ($i->type);
48 % my( $width, $height ) = ( 522, 336 );
49 % if ( grep $_ eq 'textarea', @types ) {
59 <td><% include('/elements/popup_link.html',
60 'action' => 'config.cgi?key='. $i->key.
61 ';agentnum='. $agentnum,
64 'actionlabel' => 'Enter configuration value',
65 'label' => '<b>'. $i->key. '</b>',
68 %>: <% $i->description %>
71 % foreach my $type (@types) {
73 % if ( $type eq '' ) {
76 <td><font color="#ff0000">no type</font></td>
78 % } elsif ( $type eq 'binary' ) {
81 <% $conf->exists($i->key, $agentnum)
82 ? qq!<a href="config-download.cgi?key=!. $i->key. ';agentnum='. $agentnum. qq!">download</a>!
86 % } elsif ( $type eq 'textarea'
87 % || $type eq 'editlist'
88 % || $type eq 'selectmultiple' ) {
91 <td bgcolor="#ffffff">
93 <% encode_entities(join("\n",
94 map { length($_) > 88 ? substr($_,0,88).'...' : $_ }
95 $conf->config($i->key, $agentnum)
101 % } elsif ( $type eq 'checkbox' ) {
104 <td bgcolor="#<% $conf->exists($i->key, $agentnum) ? '00ff00">YES' : 'ff0000">NO' %></td>
106 % } elsif ( $type eq 'text' || $type eq 'select' ) {
109 <td bgcolor="#ffffff">
110 <% $conf->exists($i->key, $agentnum) ? $conf->config($i->key, $agentnum) : '' %>
112 % } elsif ( $type eq 'select-sub' ) {
115 <td bgcolor="#ffffff">
116 <% $conf->config($i->key, $agentnum) %>:
117 <% &{ $i->option_sub }( $conf->config($i->key, $agentnum) ) %>
123 <font color="#ff0000">unknown type <% $type %></font>
140 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
143 if ($cgi->param('agentnum') =~ /^(\d+)$/) {
149 my $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
150 die "Agent $agentnum not found!" unless $agent;
152 $title = "Configuration for ". $agent->agent;
154 $title = 'Global Configuration';
157 my $conf = new FS::Conf;
159 my @config_items = grep { $agentnum ? $_->per_agent : 1 }
160 grep { $_->key != ~/^invoice_(html|latex|template)/ }