X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_main.cgi;h=8dd38991f10775d185ac4d6f28bccc393249d6da;hb=0857cba67d87cdbfac318f8912b9e8147600a2a2;hp=48fbf41bb9a3faa62fcded8a4a07c9d6387677a6;hpb=cce36d549b8d8cb7612f3b9a85927801de756e7e;p=freeside.git diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi index 48fbf41bb..8dd38991f 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 = ''; + $aref = ''; + if $num; + + print ''. + " $ahref$num". + "$ahref". + ( $priority || '(none)' ). + ""; + + } + print ''. + ''; + } + + my $ahref = ''; + my $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)='';