X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fconfig%2Fconfig-view.cgi;h=10fcde3c42a23d489fa7869f0d65e30f822c0668;hb=ba5975d05c4bf88a47750fecf8651821460ab30f;hp=80a65d09b7c2fc43104cca4f63de5501d4f7aa85;hpb=81e426fe755eaea508041bc2d7b25ac44c777434;p=freeside.git diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi index 80a65d09b..10fcde3c4 100644 --- a/httemplate/config/config-view.cgi +++ b/httemplate/config/config-view.cgi @@ -43,12 +43,16 @@ Click on a configuration value to change it. % foreach my $i (@{ $section_items{$section} }) { % my @types = ref($i->type) ? @{$i->type} : ($i->type); -% my( $width, $height ) = ( 522, 336 ); +%# my( $width, $height ) = ( 522, 336 ); +% my( $width, $height ) = ( 600, 336 ); % if ( grep $_ eq 'textarea', @types ) { % #800x600 % $width = 763; @@ -208,14 +212,22 @@ Click on a configuration value to change it. -% } elsif ( $type eq 'select-part_svc' ) { -% my @svcparts = $conf->config($i->key, $agentnum); +% } elsif ( $type =~ /^select-(part_svc|part_pkg|pkg_class|agent)$/ ) { +% +% my $table = $1; +% my $namecol = $namecol{$table}; +% my $pkey = dbdef->table($table)->primary_key; +% +% my @keys = $conf->config($i->key, $agentnum); @@ -300,10 +312,20 @@ Click on a configuration value to change it. +<%once> +#false laziness w/config-process.cgi +my %namecol = ( + 'part_svc' => 'svc', + 'part_pkg' => 'pkg', + 'pkg_class' => 'classname', + 'agent' => 'agent', +); + <%init> -die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); +my $curuser = $FS::CurrentUser::CurrentUser; + +die "access denied" unless $curuser->access_right('Configuration'); my $page_agent = ''; my $title; @@ -328,7 +350,7 @@ my @config_items = grep { $page_agent ? $_->per_agent : 1 } my @deleteable = qw( invoice_latexreturnaddress invoice_htmlreturnaddress ); my %deleteable = map { $_ => 1 } @deleteable; -my @sections = qw(required billing username password UI session shell BIND ); +my @sections = qw(required billing invoicing notification UI self-service username password session shell BIND telephony ); push @sections, '', 'deprecated'; my %section_items = (); @@ -342,6 +364,5 @@ my @all_agents = (); if ( $cgi->param('showagent') ) { @all_agents = qsearch('agent', { 'disabled' => '' } ); } -warn 'all agents: '. join('-', @all_agents);
- <% ucfirst($section || 'unclassified') %> configuration options + <% ucfirst($section || 'unclassified') %> +% if ( $curuser->option('show_confitem_counts') ) { + (<% scalar( @{ $section_items{$section} } ) %> items) +% }
- <% join('
', map { $_ # ': '. $svc - } - @svcparts + <% join( '
', + map { + my $key = $_; + my $record = qsearchs($table, { $pkey => $key }); + $record ? "$key: ".$record->$namecol() : $key; + } @keys ) %>