summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/misc.html
diff options
context:
space:
mode:
authorivan <ivan>2010-06-17 01:17:45 +0000
committerivan <ivan>2010-06-17 01:17:45 +0000
commit259921ee5e89a68fc79b2a358643c558ebb4fdaa (patch)
tree1f51224de7421df565fc5da772fcd5fc9469efa5 /httemplate/view/cust_main/misc.html
parentab3be0ae661c2f0560897e4ea2f55b85b1358e9f (diff)
better agent virt
Diffstat (limited to 'httemplate/view/cust_main/misc.html')
-rw-r--r--httemplate/view/cust_main/misc.html12
1 files changed, 3 insertions, 9 deletions
diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html
index 2cfe026..b98e9dc 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>