X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fmisc.html;h=8bcab0df5e27b4d55981d847937ffc4525efd5d5;hb=8966833a87b9a002c9d72c56832e35b55628dc81;hp=71e8d6973fbd579a132aca639ca1a6b806ea823b;hpb=f3717767d19f9da888e190f87a04dfa245d658b4;p=freeside.git diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html index 71e8d6973..8bcab0df5 100644 --- a/httemplate/view/cust_main/misc.html +++ b/httemplate/view/cust_main/misc.html @@ -10,12 +10,9 @@ <% ucfirst($cust_main->status) %> -%my $agent; -%if ( $num_agents == 1 ) { -% my @agents = qsearchs( 'agent', {} ); -% $agent = $agents[0]; -%} else { -% $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } ); +%unless ( scalar(@agentnums) == 1 +% && !$curuser->access_right('View customers of all agents') ) { +% my $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } ); Agent <% $agent->agentnum %>: <% $agent->agent %> @@ -31,13 +28,18 @@ % % } -% + +% #if ( $cust_main->classnum ) { + + Class + <% $cust_main->classname || '(none)' %> + +% #} + % unless ( FS::part_referral->num_part_referral == 1 ) { % my $referral = qsearchs('part_referral', { % 'refnum' => $cust_main->refnum % } ); -% - Advertising source @@ -114,8 +116,6 @@ my( $cust_main ) = @_; my $conf = new FS::Conf; my $date_format = ($conf->config('date_format') || "%m/%d/%Y"); -my $sth = dbh->prepare('SELECT COUNT(*) FROM agent') or die dbh->errstr; -$sth->execute or die $sth->errstr; -my $num_agents = $sth->fetchrow_arrayref->[0]; +my @agentnums = $FS::CurrentUser::CurrentUser->agentnums;