1 <% include("/elements/header.html",
4 'View all agents' => $p.'browse/agent.cgi',
9 Click on a configuration value to change it.
12 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/overlibmws.js"></SCRIPT>
13 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/overlibmws_iframe.js"></SCRIPT>
14 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/overlibmws_draggable.js"></SCRIPT>
15 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/iframecontentmws.js"></SCRIPT>
17 % if ($FS::UID::use_confcompat) {
19 <FONT SIZE="+1" COLOR="#ff0000">CONFIGURATION NOT STORED IN DATABASE -- USING COMPATIBILITY MODE</FONT><BR><BR>
22 % foreach my $section ( qw(required billing username password UI session
27 <A NAME="<% $section || 'unclassified' %>"></A>
29 % foreach my $nav_section ( qw(required billing username password UI session
33 % if ( $section eq $nav_section ) {
35 [<A NAME="not<% $nav_section || 'unclassified' %>" style="background-color: #cccccc"><% ucfirst($nav_section || 'unclassified') %></A>]
38 [<A HREF="#<% $nav_section || 'unclassified' %>"><% ucfirst($nav_section || 'unclassified') %></A>]
43 <TABLE BGCOLOR="#cccccc" BORDER=1 CELLSPACING=0 CELLPADDING=0 BORDERCOLOR="#999999">
45 <th colspan="2" bgcolor="#dcdcdc">
46 <% ucfirst($section || 'unclassified') %> configuration options
49 % foreach my $i (grep $_->section eq $section, @config_items) {
50 % my @types = ref($i->type) ? @{$i->type} : ($i->type);
51 % my( $width, $height ) = ( 522, 336 );
52 % if ( grep $_ eq 'textarea', @types ) {
62 <td><a href="javascript:void(0);" onClick="overlib( OLiframeContent('config.cgi?key=<% $i->key %>;agentnum=<% $agentnum %>', <% $width %>, <% $height %>, 'config_popup' ), CAPTION, 'Enter configuration value', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;" name="<% $i->key %>">
63 %# <b><% $i->key %></b></a> - <% $i->description %>
64 <b><% $i->key %></b></a>: <% $i->description %>
67 % foreach my $type (@types) {
69 % if ( $type eq '' ) {
72 <td><font color="#ff0000">no type</font></td>
74 % } elsif ( $type eq 'binary' ) {
77 <% $conf->exists($i->key, $agentnum)
78 ? qq!<a href="config-download.cgi?key=!. $i->key. ';agentnum='. $agentnum. qq!">download</a>!
82 % } elsif ( $type eq 'textarea'
83 % || $type eq 'editlist'
84 % || $type eq 'selectmultiple' ) {
87 <td bgcolor="#ffffff">
89 <% encode_entities(join("\n",
90 map { length($_) > 88 ? substr($_,0,88).'...' : $_ }
91 $conf->config($i->key, $agentnum)
97 % } elsif ( $type eq 'checkbox' ) {
100 <td bgcolor="#<% $conf->exists($i->key, $agentnum) ? '00ff00">YES' : 'ff0000">NO' %></td>
102 % } elsif ( $type eq 'text' || $type eq 'select' ) {
105 <td bgcolor="#ffffff">
106 <% $conf->exists($i->key, $agentnum) ? $conf->config($i->key, $agentnum) : '' %>
108 % } elsif ( $type eq 'select-sub' ) {
111 <td bgcolor="#ffffff">
112 <% $conf->config($i->key, $agentnum) %>:
113 <% &{ $i->option_sub }( $conf->config($i->key, $agentnum) ) %>
119 <font color="#ff0000">unknown type <% $type %></font>
136 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
139 if ($cgi->param('agentnum') =~ /^(\d+)$/) {
145 my $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
146 die "Agent $agentnum not found!" unless $agent;
148 $title = "Configuration for ". $agent->agent;
150 $title = 'Global Configuration';
153 my $conf = new FS::Conf;
155 my @config_items = grep { $agentnum ? $_->per_agent : 1 }
156 grep { $_->key != ~/^invoice_(html|latex|template)/ }