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' ) {
73 <% $conf->exists($i->key, $agentnum)
74 ? '<img src="config-image.cgi?key='. $i->key.
75 ';agentnum='. $agentnum. '">'
80 % } elsif ( $type eq 'binary' ) {
84 <% $conf->exists($i->key, $agentnum)
85 ? qq!<a href="config-download.cgi?key=!. $i->key. ';agentnum='. $agentnum. qq!">download</a>!
90 % } elsif ( $type eq 'textarea'
91 % || $type eq 'editlist'
92 % || $type eq 'selectmultiple' ) {
95 <td id="<% $i->key.$n %>" bgcolor="#ffffff">
97 <% encode_entities(join("\n",
98 map { length($_) > 88 ? substr($_,0,88).'...' : $_ }
99 $conf->config($i->key, $agentnum)
105 % } elsif ( $type eq 'checkbox' ) {
108 <td id="<% $i->key.$n %>" bgcolor="#<% $conf->exists($i->key, $agentnum) ? '00ff00">YES' : 'ff0000">NO' %></td>
110 % } elsif ( $type eq 'text' || $type eq 'select' ) {
113 <td id="<% $i->key.$n %>" bgcolor="#ffffff">
114 <% $conf->exists($i->key, $agentnum) ? $conf->config($i->key, $agentnum) : '' %>
116 % } elsif ( $type eq 'select-sub' ) {
119 <td id="<% $i->key.$n %>" bgcolor="#ffffff">
120 <% $conf->config($i->key, $agentnum) %>:
121 <% &{ $i->option_sub }( $conf->config($i->key, $agentnum) ) %>
127 <font color="#ff0000">unknown type <% $type %></font>
145 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
150 if ($cgi->param('agentnum') =~ /^(\d+)$/) {
152 my $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
153 die "Agent $agentnum not found!" unless $agent;
155 push @menubar, 'View all agents' => $p.'browse/agent.cgi';
156 $title = 'Agent Configuration for '. $agent->agent;
158 $title = 'Global Configuration';
161 my $conf = new FS::Conf;
163 my @config_items = grep { $agentnum ? $_->per_agent : 1 }
164 grep { $_->key != ~/^invoice_(html|latex|template)/ }
167 my @sections = qw(required billing username password UI session shell BIND );
168 push @sections, '', 'deprecated';
170 my %section_items = ();
171 foreach my $section (@sections) {
172 $section_items{$section} = [ grep $_->section eq $section, @config_items ];
175 @sections = grep scalar( @{ $section_items{$_} } ), @sections;