From c0e8da2f1e89729efa1032241e4239765a296514 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 19 Jun 2006 02:33:52 +0000 Subject: agent virtualization, take one (stuff from "inactive" changeset snuck into cust_main.pm and the package reporting changeset in search/cust_pkg.cgi here too) --- httemplate/search/cust_main.cgi | 49 +++++++++++++++++++++++++++-------------- 1 file changed, 32 insertions(+), 17 deletions(-) (limited to 'httemplate/search/cust_main.cgi') diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi index 733e5dc15..5b7ccec1c 100755 --- a/httemplate/search/cust_main.cgi +++ b/httemplate/search/cust_main.cgi @@ -117,6 +117,10 @@ if ( $cgi->param('browse') my $addl_qual = join(' AND ', @qual); + #here is the agent virtualization + $addl_qual .= ( $addl_qual ? ' AND ' : '' ). + $FS::CurrentUser::CurrentUser->agentnums_sql; + if ( $addl_qual ) { $qual .= ' AND ' if $qual; $qual .= $addl_qual; @@ -322,32 +326,43 @@ END print "

". $pager. include('/elements/table-grid.html'). < - - (bill) name - company + + (bill) name + company END if ( defined dbdef->table('cust_main')->column('ship_last') ) { print <(service) name - company + (service) name + company END } foreach my $addl_header ( @addl_headers ) { - print "$addl_header"; + print ''. "$addl_header"; } print <Packages - Services + Packages + Services END + my $bgcolor1 = '#eeeeee'; + my $bgcolor2 = '#ffffff'; + my $bgcolor; + my(%saw,$cust_main); foreach $cust_main ( sort $sortby grep(!$saw{$_->custnum}++, @cust_main) ) { + + if ( $bgcolor eq $bgcolor1 ) { + $bgcolor = $bgcolor2; + } else { + $bgcolor = $bgcolor1; + } + my($custnum,$last,$first,$company)=( $cust_main->custnum, $cust_main->getfield('last'), @@ -377,9 +392,9 @@ END %> - ><%= $custnum %> - ><%= "$last, $first" %> - ><%= $pcompany %> + ><%= $custnum %> + ><%= "$last, $first" %> + ><%= $pcompany %> <% if ( defined dbdef->table('cust_main')->column('ship_last') ) { @@ -393,14 +408,14 @@ END : ' '; %> - ><%= "$ship_last, $ship_first" %> - ><%= $pship_company %> + ><%= "$ship_last, $ship_first" %> + ><%= $pship_company %> <% } foreach my $addl_col ( @addl_cols ) { %> - ALIGN=right> + ALIGN=right> <% if ( $addl_col eq 'tickets' ) { if ( @custom_priorities ) { @@ -457,14 +472,14 @@ END #my(@cust_svc) = qsearch( 'cust_svc', { 'pkgnum' => $_->pkgnum } ); my $rowspan = scalar(@cust_svc) || 1; - print $n1, qq!$pkg - $comment!; + print $n1, qq!$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'; - print $n2,qq!$label!, - qq!$value!; + print $n2,qq!$label!, + qq!$value!; $n2=""; } #print qq!\n!; -- cgit v1.2.1