1 <% include("/elements/header.html", $title, menubar(@menubar)) %>
3 Click on a configuration value to change it.
6 <% include('/elements/init_overlib.html') %>
8 % if ($FS::UID::use_confcompat) {
9 <FONT SIZE="+1" COLOR="#ff0000">CONFIGURATION NOT STORED IN DATABASE -- USING COMPATIBILITY MODE</FONT><BR><BR>
12 % foreach my $section (@sections) {
14 <A NAME="<% $section || 'unclassified' %>"></A>
17 % foreach my $nav_section (@sections) {
19 % if ( $section eq $nav_section ) {
20 [<A NAME="not<% $nav_section || 'unclassified' %>" style="background-color: #cccccc"><% ucfirst($nav_section || 'unclassified') %></A>]
22 [<A HREF="#<% $nav_section || 'unclassified' %>"><% ucfirst($nav_section || 'unclassified') %></A>]
28 <TABLE BGCOLOR="#cccccc" BORDER=1 CELLSPACING=0 CELLPADDING=0 BORDERCOLOR="#999999">
30 <th colspan="2" bgcolor="#dcdcdc">
31 <% ucfirst($section || 'unclassified') %> configuration options
34 % foreach my $i (@{ $section_items{$section} }) {
35 % my @types = ref($i->type) ? @{$i->type} : ($i->type);
36 % my( $width, $height ) = ( 522, 336 );
37 % if ( grep $_ eq 'textarea', @types ) {
47 <td><% include('/elements/popup_link.html',
48 'action' => 'config.cgi?key='. $i->key.
49 ';agentnum='. $agentnum,
52 'actionlabel' => 'Enter configuration value',
53 'label' => '<b>'. $i->key. '</b>',
56 %>: <% $i->description %>
61 % foreach my $type (@types) {
63 % if ( $type eq '' ) {
66 <td><font color="#ff0000">no type</font></td>
69 % } elsif ( $type eq 'image' ) {
72 <td bgcolor='#ffffff'>
73 <% $conf->exists($i->key, $agentnum)
74 ? '<img src="config-image.cgi?key='. $i->key.
75 ';agentnum='. $agentnum. '">'
82 <% $conf->exists($i->key, $agentnum)
83 ? qq!<a href="config-download.cgi?key=!. $i->key. ';agentnum='. $agentnum. qq!">download</a>!
89 % } elsif ( $type eq 'binary' ) {
93 <% $conf->exists($i->key, $agentnum)
94 ? qq!<a href="config-download.cgi?key=!. $i->key. ';agentnum='. $agentnum. qq!">download</a>!
100 % } elsif ( $type eq 'textarea'
101 % || $type eq 'editlist'
102 % || $type eq 'selectmultiple' ) {
105 <td id="<% $i->key.$n %>" bgcolor="#ffffff">
106 <font size="-2"><pre>
107 <% encode_entities(join("\n",
108 map { length($_) > 88 ? substr($_,0,88).'...' : $_ }
109 $conf->config($i->key, $agentnum)
115 % } elsif ( $type eq 'checkbox' ) {
118 <td id="<% $i->key.$n %>" bgcolor="#<% $conf->exists($i->key, $agentnum) ? '00ff00">YES' : 'ff0000">NO' %></td>
120 % } elsif ( $type eq 'text' || $type eq 'select' ) {
123 <td id="<% $i->key.$n %>" bgcolor="#ffffff">
124 <% $conf->exists($i->key, $agentnum) ? $conf->config($i->key, $agentnum) : '' %>
126 % } elsif ( $type eq 'select-sub' ) {
129 <td id="<% $i->key.$n %>" bgcolor="#ffffff">
130 <% $conf->config($i->key, $agentnum) %>:
131 <% &{ $i->option_sub }( $conf->config($i->key, $agentnum) ) %>
137 <font color="#ff0000">unknown type <% $type %></font>
155 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
160 if ($cgi->param('agentnum') =~ /^(\d+)$/) {
162 my $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
163 die "Agent $agentnum not found!" unless $agent;
165 push @menubar, 'View all agents' => $p.'browse/agent.cgi';
166 $title = 'Agent Configuration for '. $agent->agent;
168 $title = 'Global Configuration';
171 my $conf = new FS::Conf;
173 my @config_items = grep { $agentnum ? $_->per_agent : 1 }
174 grep { $_->key != ~/^invoice_(html|latex|template)/ }
177 my @sections = qw(required billing username password UI session shell BIND );
178 push @sections, '', 'deprecated';
180 my %section_items = ();
181 foreach my $section (@sections) {
182 $section_items{$section} = [ grep $_->section eq $section, @config_items ];
185 @sections = grep scalar( @{ $section_items{$_} } ), @sections;