summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/misc.html
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/view/cust_main/misc.html')
-rw-r--r--httemplate/view/cust_main/misc.html31
1 files changed, 9 insertions, 22 deletions
diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html
index 6e90a0b4c..2cfe0263f 100644
--- a/httemplate/view/cust_main/misc.html
+++ b/httemplate/view/cust_main/misc.html
@@ -10,25 +10,12 @@
<TD BGCOLOR="#ffffff"><FONT COLOR="#<% $cust_main->statuscolor %>"><B><% ucfirst($cust_main->status) %></B></FONT></TD>
</TR>
-% my @part_tag = $cust_main->part_tag;
-% if ( $conf->config('cust_tag-location') =~ /^(cust_misc|)$/ && @part_tag ) {
-<TR>
- <TD ALIGN="right">Tags</TD>
- <TD BGCOLOR="#ffffff">
-% foreach my $part_tag ( @part_tag ) {
- <FONT <% length($part_tag->tagcolor)
- ? 'STYLE="background-color:#'.$part_tag->tagcolor.'"'
- : '' %>
- ><% $part_tag->tagname.': '. $part_tag->tagdesc |h %></FONT>
- <BR>
-% }
- </TD>
-</TR>
-% }
-
-%unless ( scalar(@agentnums) == 1
-% && !$curuser->access_right('View customers of all agents') ) {
-% my $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } );
+%my $agent;
+%if ( $num_agents == 1 ) {
+% my @agents = qsearchs( 'agent', {} );
+% $agent = $agents[0];
+%} else {
+% $agent = qsearchs('agent',{ 'agentnum' => $cust_main->agentnum } );
<TR>
<TD ALIGN="right">Agent</TD>
<TD BGCOLOR="#ffffff"><% $agent->agentnum %>: <% $agent->agent %></TD>
@@ -132,8 +119,8 @@ my( $cust_main ) = @_;
my $conf = new FS::Conf;
my $date_format = ($conf->config('date_format') || "%m/%d/%Y");
-my $curuser = $FS::CurrentUser::CurrentUser;
-
-my @agentnums = $curuser->agentnums;
+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];
</%init>