From dda497584a2e12907bba7cf07051fe34ede63b32 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 6 Dec 2004 14:00:43 +0000 Subject: 1st try at adding custom field handling --- httemplate/search/cust_main.cgi | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'httemplate') diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi index 48fbf41bb..7d15d1cfc 100755 --- a/httemplate/search/cust_main.cgi +++ b/httemplate/search/cust_main.cgi @@ -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,28 @@ END } foreach my $addl_col ( @addl_cols ) { - print "". - qq!!. - $cust_main->get($addl_col). - ""; + print ""; + if ( $addl_col eq 'tickets' ) { + if ( @custom_priorities ) { + foreach my $priority ( @custom_priorities ) { + print ''. + FS::TicketSystem->num_customer_tickets($custnum,$priority). + " $priority
"; + } + } + print ''. + $cust_main->get($addl_col); + print ' total' + if @custom_priorities; + print ""; + } else { + print $cust_main->get($addl_col); + } + print ""; } my($n1)=''; -- cgit v1.2.1