X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_main.cgi;h=aae8c7e99eedb838b9753c4cb9b51ca054b7cc6d;hb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924;hp=b8af1fdc43b7ba6c7ed90351093eaa4356d151dd;hpb=8ef00c68688492b2afa3dde8d3d467f89f238c40;p=freeside.git diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi index b8af1fdc4..aae8c7e99 100755 --- a/httemplate/search/cust_main.cgi +++ b/httemplate/search/cust_main.cgi @@ -119,13 +119,31 @@ % $cust_main->company, % ); % -% my(@lol_cust_svc); -% my($rowspan)=0;#scalar( @{$all_pkgs{$custnum}} ); -% foreach ( @{$all_pkgs{$custnum}} ) { -% my @cust_svc = $_->cust_svc; -% push @lol_cust_svc, \@cust_svc; -% $rowspan += scalar(@cust_svc) || 1; -% } +% my @all_cust_svc; +% my @pkg_rowspans; +% foreach my $cust_pkg ( @{$all_pkgs{$custnum}} ) { +% my %cust_svc_by_svcpart; +% my $rows = 0; +% foreach my $part_svc ( $cust_pkg->part_svc ) { +% my $svcpart = $part_svc->svcpart; +% my $num_cust_svc = $cust_pkg->num_cust_svc($svcpart); +% if ( $large_pkg_size > 0 and $num_cust_svc >= $large_pkg_size ) { +% # don't retrieve the cust_svc records, just stash the +% # part_svc and num_cust_svc for later +% $cust_svc_by_svcpart{$svcpart} = +% [ 'summarize', $part_svc, $num_cust_svc ]; +% $rows += 2; +% } +% elsif ( $num_cust_svc ) { +% $cust_svc_by_svcpart{$svcpart} = [ $cust_pkg->cust_svc($svcpart) ]; +% $rows += $num_cust_svc; +% } #if summarize +% } #foreach $part_svc +% $rows ||= 1; # in case the package has no services +% push @all_cust_svc, \%cust_svc_by_svcpart; +% push @pkg_rowspans, $rows; +% } #foreach $cust_pkg +% my $rowspan = List::Util::sum(@pkg_rowspans) || 1; % % my $view; % if ( defined $cgi->param('quickpay') && $cgi->param('quickpay') eq 'yes' ) { @@ -141,16 +159,16 @@ % my $statuscol = $cust_main->statuscolor;
% } else { - | ALIGN=right> + | ALIGN=right> % } % my $ahref = ''; @@ -227,7 +245,7 @@ | % } else { -ALIGN=right> + | ALIGN=right> <% $cust_main->get($addl_col) %> | @@ -245,29 +263,57 @@ % : ';show=packages'; % my $frag = "cust_pkg$pkgnum"; #hack for IE ignoring real #fragment % my $pkgview = "${p}view/cust_main.cgi?custnum=$custnum$show;fragment=$frag#$frag"; -% my @cust_svc = @{shift @lol_cust_svc}; -% my $rowspan = scalar(@cust_svc) || 1; +% # cust_svc stuff, built earlier +% my %cust_svc_by_svcpart = %{ shift @all_cust_svc }; +% my $pkg_rowspan = shift @pkg_rowspans; - <% $n1 %>+ <% $n1 %> | <% $pkg_comment %> | % my $n2 = ''; -% foreach my $cust_svc ( @cust_svc ) { -% my($label, $value, $svcdb) = $cust_svc->label; -% my($svcnum) = $cust_svc->svcnum; -% my($sview) = $p.'view'; - <% $n2 %> -+% my $td = ' | '; +% +% foreach my $svcpart ( sort keys %cust_svc_by_svcpart ) { #sort order? +% my $these = $cust_svc_by_svcpart{$svcpart}; +% if ( $these->[0] eq 'summarize' ) { +% my $part_svc = $these->[1]; +% my $num_cust_svc = $these->[2]; + <% $n2 %> +% # summarize +% # link opens a new search for this pkgnum/svcpart combo +% my $href = $p.'search/cust_pkg_svc.html?svcpart='.$svcpart. +% ';pkgnum='.$pkgnum; + <% $td %> + <% $part_svc->svc %> + | + <% $td %> + (<% mt("view all [_1]", $num_cust_svc) |h %>) + +
---|---|---|---|---|---|---|---|
+ <% $td %> <% FS::UI::Web::svc_label_link($m, $cust_svc->part_svc, $cust_svc) %> | -% $n2="|||||||
% } % @@ -275,7 +321,7 @@ % } % % unless ( @{$all_pkgs{$custnum}} ) { - | !; + | % } % |