X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fconfig%2Fconfig-view.cgi;h=f5cead575f5e416c5d58af46d587f6df1b9fd6f5;hb=c082dd1a35a2e25b97f28ee137ec2c5b3b8052ca;hp=ff7913d780571e1d517d108dfbbd5625ed9285aa;hpb=3ce7691203a7737406bf2d4442f7fd84b81f847e;p=freeside.git diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi index ff7913d78..f5cead575 100644 --- a/httemplate/config/config-view.cgi +++ b/httemplate/config/config-view.cgi @@ -1,7 +1,24 @@ - -<% include("/elements/header.html",'View Configuration', menubar( 'Main Menu' => $p, - 'Edit Configuration' => 'config.cgi' ) ) %> -% my $conf = new FS::Conf; my @config_items = $conf->config_items; +<% include("/elements/header.html", + $title, + menubar( + 'View all agents' => $p.'browse/agent.cgi', + ) + ) +%> + +Click on a configuration value to change it. +

+ + + + + + +% if ($FS::UID::use_confcompat) { + + CONFIGURATION NOT STORED IN DATABASE -- USING COMPATIBILITY MODE

+%} +% % foreach my $section ( qw(required billing username password UI session % shell BIND % ), @@ -23,54 +40,77 @@ % }
- <% table("#cccccc", 2) %> + % foreach my $i (grep $_->section eq $section, @config_items) { +% my @types = ref($i->type) ? @{$i->type} : ($i->type); +% my( $width, $height ) = ( 522, 336 ); +% if ( grep $_ eq 'textarea', @types ) { +% #800x600 +% $width = 763; +% $height = 408; +% #1024x768 +% #$width = +% #$height = +% } - +
<% ucfirst($section || 'unclassified') %> configuration options
- <% $i->key %> - <% $i->description %> - +%# <% $i->key %> - <% $i->description %> + <% $i->key %>: <% $i->description %> + -% foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) { +% foreach my $type (@types) { % my $n = 0; % if ( $type eq '' ) { +% } elsif ( $type eq 'binary' ) { + + + <% $conf->exists($i->key, $agentnum) + ? qq!download! + : 'empty' + %> + % } elsif ( $type eq 'textarea' % || $type eq 'editlist' % || $type eq 'selectmultiple' ) { % } elsif ( $type eq 'checkbox' ) { - + % } elsif ( $type eq 'text' || $type eq 'select' ) { % } elsif ( $type eq 'select-sub' ) { % } else { @@ -90,3 +130,30 @@ +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); + +my $agentnum = ''; +if ($cgi->param('agentnum') =~ /^(\d+)$/) { + $agentnum = $1; +} + +my $title; +if ($agentnum) { + my $agent = qsearchs('agent', { 'agentnum' => $agentnum } ); + die "Agent $agentnum not found!" unless $agent; + + $title = "Configuration for ". $agent->agent; +} else { + $title = 'Global Configuration'; +} + +my $conf = new FS::Conf; + +my @config_items = grep { $agentnum ? $_->per_agent : 1 } + grep { $_->key != ~/^invoice_(html|latex|template)/ } + $conf->config_items; + +
no type
-
-<% encode_entities(join("\n", $conf->config($i->key) ) ) %>
-
+
+<% encode_entities(join("\n",
+     map { length($_) > 88 ? substr($_,0,88).'...' : $_ }
+         $conf->config($i->key, $agentnum)
+   ) )
+%>
+
YES' : 'ff0000">NO' %>YES' : 'ff0000">NO' %>
- <% $conf->exists($i->key) ? $conf->config($i->key) : '' %> + <% $conf->exists($i->key, $agentnum) ? $conf->config($i->key, $agentnum) : '' %>
- <% $conf->config($i->key) %>: - <% &{ $i->option_sub }( $conf->config($i->key) ) %> + <% $conf->config($i->key, $agentnum) %>: + <% &{ $i->option_sub }( $conf->config($i->key, $agentnum) ) %>