X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fconfig%2Fconfig-view.cgi;h=7516dabab4bf9c64e65800f3ec3583e8d4aa58b0;hb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c;hp=856a2eaef76ad2125713d7ad677e55642a727ff3;hpb=29347e1d34d5468994af6e219f00582e525688ae;p=freeside.git diff --git a/httemplate/config/config-view.cgi b/httemplate/config/config-view.cgi index 856a2eaef..7516dabab 100644 --- a/httemplate/config/config-view.cgi +++ b/httemplate/config/config-view.cgi @@ -43,7 +43,10 @@ Click on a configuration value to change it. % foreach my $i (@{ $section_items{$section} }) { @@ -210,13 +213,21 @@ Click on a configuration value to change it. % } elsif ( $type =~ /^select-(part_svc|part_pkg|pkg_class)$/ ) { +% +% my $table = $1; +% my $namecol = $namecol{$table}; +% my $pkey = dbdef->table($table)->primary_key; +% % my @keys = $conf->config($i->key, $agentnum); @@ -301,10 +312,19 @@ 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', +); + <%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; @@ -329,7 +349,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 = (); @@ -343,6 +363,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, $pkg, whatever - } - @keys + <% join( '
', + map { + my $key = $_; + my $record = qsearchs($table, { $pkey => $key }); + $record ? "$key: ".$record->$namecol() : $key; + } @keys ) %>