X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fbrowse%2Fpart_svc.cgi;h=8b596752f814ebd7fe959fed66d24103cfc0752f;hp=dee439466f43b544436aa2e92e55cea0c1398081;hb=3f2a7b01b59902faed5767d81e2959e131bdbdfd;hpb=46fe3dbcb3ca97d1f3c70d49351846cf0ab6461d diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi index dee439466..8b596752f 100755 --- a/httemplate/browse/part_svc.cgi +++ b/httemplate/browse/part_svc.cgi @@ -64,7 +64,6 @@ function part_export_areyousure(href) { Required -% my $conf = FS::Conf->new; % foreach my $part_svc ( @part_svc ) { % my $svcdb = $part_svc->svcdb; % my $svc_x = "FS::$svcdb"->new( { svcpart => $part_svc->svcpart } ); @@ -112,8 +111,24 @@ function part_export_areyousure(href) { % } - CLASS="grid" BGCOLOR="<% $bgcolor %>"> - <% $part_svc->svc %> + CLASS="grid" BGCOLOR="<% $bgcolor %>"> + + <% $part_svc->svc %> + +% # any alternate names of the service +% my %msgcat = map { $_->locale => $_ } $part_svc->part_svc_msgcat; +% my %labels = map { $_ => FS::Locales->description($_) } keys %msgcat; +% my @locales = sort { $labels{$a} cmp $labels{$b} } keys %msgcat; +% if ( @locales ) { +
+ +% foreach my $locale (@locales) { + <% $labels{$locale} %>: <% $msgcat{$locale}->get('svc') %> +
+% } +
+% } + CLASS="grid" BGCOLOR="<% $bgcolor %>"> <% $svcdb %> @@ -121,12 +136,12 @@ function part_export_areyousure(href) { CLASS="grid" BGCOLOR="<% $bgcolor %>"> % my $svcurl_active = svc_url( 'ahref' => 1, 'm' => $m, 'action' => 'search', 'part_svc' => $part_svc, 'query' => "svcpart=". $part_svc->svcpart . "&cancelled=0"); % my $svcurl_cancel = svc_url( 'ahref' => 1, 'm' => $m, 'action' => 'search', 'part_svc' => $part_svc, 'query' => "svcpart=". $part_svc->svcpart . "&cancelled=1"); - <% $num_cust_svc_active{$part_svc->svcpart} %> <% $num_cust_svc_active{$part_svc->svcpart} ? $svcurl_active : '' %>active<% $num_cust_svc_active{$part_svc->svcpart} ? '' : '' %> -% if ( $num_cust_svc_cancelled{$part_svc->svcpart} ) { + <% $num_cust_svc_active{$part_svc->svcpart} %> <% $num_cust_svc_active{$part_svc->svcpart} || $disable_counts ? $svcurl_active : '' %>active<% $num_cust_svc_active{$part_svc->svcpart} || $disable_counts ? '' : '' %> +% if ( $num_cust_svc_cancelled{$part_svc->svcpart} || $disable_counts ) {
<% $num_cust_svc_cancelled{$part_svc->svcpart} %> <% $svcurl_cancel %>cancelled % } -% if ( $num_cust_svc{$part_svc->svcpart} ) { -
[ change ] +% if ( $num_cust_svc{$part_svc->svcpart} || $disable_counts ) { +
[ change ] % } @@ -223,6 +238,9 @@ function part_export_areyousure(href) { die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); +my $conf = FS::Conf->new; +my $disable_counts = $conf->exists('config-disable_counts') ? 1 : 0; + #code duplication w/ edit/part_svc.cgi, should move this hash to part_svc.pm my %flag = ( '' => '', @@ -235,6 +253,7 @@ my %flag = ( 'A' => 'Automatically filled in from inventory', 'H' => 'Selected from hardware class', 'X' => 'Excluded', + 'P' => 'From package 477 information', ); my %search; @@ -259,10 +278,13 @@ my $total = scalar(@part_svc); my %num_cust_svc_active; my %num_cust_svc_cancelled; my %num_cust_svc; -foreach my $part_svc (@part_svc) { - $num_cust_svc{$part_svc->svcpart} = $part_svc->num_cust_svc; - $num_cust_svc_cancelled{$part_svc->svcpart} = $part_svc->num_cust_svc_cancelled; - $num_cust_svc_active{$part_svc->svcpart} = $num_cust_svc{$part_svc->svcpart} - $num_cust_svc_cancelled{$part_svc->svcpart}; + +unless ( $disable_counts ) { + foreach my $part_svc (@part_svc) { + $num_cust_svc{$part_svc->svcpart} = $part_svc->num_cust_svc; + $num_cust_svc_cancelled{$part_svc->svcpart} = $part_svc->num_cust_svc_cancelled; + $num_cust_svc_active{$part_svc->svcpart} = $num_cust_svc{$part_svc->svcpart} - $num_cust_svc_cancelled{$part_svc->svcpart}; + } } if ( $cgi->param('orderby') eq 'active' ) {