1 <% include("/elements/header.html",
5 'View all agents' => $p.'browse/agent.cgi',
10 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/overlibmws.js"></SCRIPT>
11 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/overlibmws_iframe.js"></SCRIPT>
12 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/overlibmws_draggable.js"></SCRIPT>
13 <SCRIPT TYPE="text/javascript" SRC="<%$fsurl%>elements/iframecontentmws.js"></SCRIPT>
15 % if ($FS::UID::use_confcompat) {
17 <FONT SIZE="+1" COLOR="#ff0000">CONFIGURATION NOT STORED IN DATABASE -- USING COMPATIBILITY MODE</FONT><BR><BR>
20 % foreach my $section ( qw(required billing username password UI session
25 <A NAME="<% $section || 'unclassified' %>"></A>
27 % foreach my $nav_section ( qw(required billing username password UI session
31 % if ( $section eq $nav_section ) {
33 [<A NAME="not<% $nav_section || 'unclassified' %>" style="background-color: #cccccc"><% ucfirst($nav_section || 'unclassified') %></A>]
36 [<A HREF="#<% $nav_section || 'unclassified' %>"><% ucfirst($nav_section || 'unclassified') %></A>]
41 <% include('/elements/table.html', '#cccccc' ) %>
43 <th colspan="2" bgcolor="#dcdcdc">
44 <% ucfirst($section || 'unclassified') %> configuration options
47 % foreach my $i (grep $_->section eq $section, @config_items) {
50 <td><a href="javascript:void(0);" onClick="overlib( OLiframeContent('config.cgi?key=<% $i->key %>;agentnum=<% $agentnum %>', 522, 336, 'config_popup' ), CAPTION, 'Enter configuration value', STICKY, AUTOSTATUSCAP, MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK ); return false;" name="<% $i->key %>">
51 <b><% $i->key %></b></a> - <% $i->description %>
54 % foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) {
56 % if ( $type eq '' ) {
59 <td><font color="#ff0000">no type</font></td>
61 % } elsif ( $type eq 'binary' ) {
64 <% $conf->exists($i->key, $agentnum)
65 ? qq!<a href="config-download.cgi?key=!. $i->key. ';agentnum='. $agentnum. qq!">download</a>!
69 % } elsif ( $type eq 'textarea'
70 % || $type eq 'editlist'
71 % || $type eq 'selectmultiple' ) {
74 <td bgcolor="#ffffff">
76 <% encode_entities(join("\n", $conf->config($i->key, $agentnum) ) ) %>
80 % } elsif ( $type eq 'checkbox' ) {
83 <td bgcolor="#<% $conf->exists($i->key, $agentnum) ? '00ff00">YES' : 'ff0000">NO' %></td>
85 % } elsif ( $type eq 'text' || $type eq 'select' ) {
88 <td bgcolor="#ffffff">
89 <% $conf->exists($i->key, $agentnum) ? $conf->config($i->key, $agentnum) : '' %>
91 % } elsif ( $type eq 'select-sub' ) {
94 <td bgcolor="#ffffff">
95 <% $conf->config($i->key, $agentnum) %>:
96 <% &{ $i->option_sub }( $conf->config($i->key, $agentnum) ) %>
102 <font color="#ff0000">unknown type <% $type %></font>
119 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
122 if ($cgi->param('agentnum') =~ /^(\d+)$/) {
128 my $agent = qsearchs('agent', { 'agentnum' => $agentnum } );
129 die "Agent $agentnum not found!" unless $agent;
131 $title = "Configuration for ". $agent->agent;
133 $title = 'Global Configuration';
136 my $conf = new FS::Conf;
138 my @config_items = grep { $agentnum ? $_->per_agent : 1 }
139 grep { $_->key != ~/^invoice_(html|latex|template)/ }