X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_main.cgi;h=ecff4bf3b6581632ed00a043dd782345004e7684;hb=71c6e9e04a6faadedaf2238f7e7fcf607d4721cc;hp=48fbf41bb9a3faa62fcded8a4a07c9d6387677a6;hpb=cce36d549b8d8cb7612f3b9a85927801de756e7e;p=freeside.git
diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi
index 48fbf41bb..ecff4bf3b 100755
--- a/httemplate/search/cust_main.cgi
+++ b/httemplate/search/cust_main.cgi
@@ -71,7 +71,7 @@ if ( $cgi->param('browse')
} elsif ( $query eq 'tickets' ) {
$sortby = \*tickets_sort;
$orderby = "ORDER BY tickets DESC";
- push @select, FS::TicketSystem->sql_customer_tickets. " as tickets";
+ push @select, FS::TicketSystem->sql_num_customer_tickets. " as tickets";
push @addl_headers, 'Tickets';
push @addl_cols, 'tickets';
} else {
@@ -279,6 +279,7 @@ if ( scalar(@cust_main) == 1 && ! $cgi->param('referral_custnum') ) {
}
print ' cancelled customers )';
}
+
if ( $cgi->param('referral_custnum') ) {
$cgi->param('referral_custnum') =~ /^(\d+)$/
or eidiot "Illegal referral_custnum\n";
@@ -314,6 +315,13 @@ END
'';
}
+ my @custom_priorities = ();
+ if ( $conf->config('ticket_system-custom_priority_field')
+ && @{[ $conf->config('ticket_system-custom_priority_field-values') ]} ) {
+ @custom_priorities =
+ $conf->config('ticket_system-custom_priority_field-values');
+ }
+
print "
". $pager. &table(). <
|
@@ -390,12 +398,47 @@ END
}
foreach my $addl_col ( @addl_cols ) {
- print "".
- qq!!.
- $cust_main->get($addl_col).
- " | ";
+ print "";
+ if ( $addl_col eq 'tickets' ) {
+ if ( @custom_priorities ) {
+ print &itable('', 0);
+ foreach my $priority ( @custom_priorities, '' ) {
+
+ my $num =
+ FS::TicketSystem->num_customer_tickets($custnum,$priority);
+ my $ahref = '';
+ $ahref= ''
+ if $num;
+
+ print ''.
+ " $ahref$num | ".
+ "$ahref".
+ ( $priority || '(none)' ).
+ " | ";
+
+ }
+ print ' | '.
+ '';
+ }
+
+ my $ahref = '';
+ $ahref = ''
+ if $cust_main->get($addl_col);
+
+ print $ahref. $cust_main->get($addl_col). '';
+ print " | ".
+ "${ahref}Total".
+ " | "
+ if @custom_priorities;
+
+ } else {
+ print $cust_main->get($addl_col);
+ }
+ print " | ";
}
my($n1)='';