[freeside-commits] freeside/httemplate/view/cust_main misc.html, 1.14, 1.15
Ivan,,,
ivan at wavetail.420.am
Wed Jun 16 18:17:47 PDT 2010
Update of /home/cvs/cvsroot/freeside/httemplate/view/cust_main
In directory wavetail.420.am:/tmp/cvs-serv12450
Modified Files:
misc.html
Log Message:
better agent virt
Index: misc.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_main/misc.html,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -w -d -r1.14 -r1.15
--- misc.html 29 Oct 2009 18:38:08 -0000 1.14
+++ misc.html 17 Jun 2010 01:17:45 -0000 1.15
@@ -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 $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>
More information about the freeside-commits
mailing list