diff options
author | ivan <ivan> | 2010-06-17 01:17:45 +0000 |
---|---|---|
committer | ivan <ivan> | 2010-06-17 01:17:45 +0000 |
commit | 259921ee5e89a68fc79b2a358643c558ebb4fdaa (patch) | |
tree | 1f51224de7421df565fc5da772fcd5fc9469efa5 /httemplate/view/cust_main/misc.html | |
parent | ab3be0ae661c2f0560897e4ea2f55b85b1358e9f (diff) |
better agent virt
Diffstat (limited to 'httemplate/view/cust_main/misc.html')
-rw-r--r-- | httemplate/view/cust_main/misc.html | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html index 2cfe0263f..b98e9dc3e 100644 --- a/httemplate/view/cust_main/misc.html +++ b/httemplate/view/cust_main/misc.html @@ -10,12 +10,8 @@ <TD BGCOLOR="#ffffff"><FONT COLOR="#<% $cust_main->statuscolor %>"><B><% ucfirst($cust_main->status) %></B></FONT></TD> </TR> -%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 ) { +% my $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } ); <TR> <TD ALIGN="right">Agent</TD> <TD BGCOLOR="#ffffff"><% $agent->agentnum %>: <% $agent->agent %></TD> @@ -119,8 +115,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; </%init> |