X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_main.cgi;h=665f5637dd5a6ca24a9ecf9624ee72d7ca16c857;hb=65886f8e35ddd4a618760d7771c6163521cb43b5;hp=778cdf2b02689478f26f00270ebbfd21ea8f1b76;hpb=22edb078bfa5aebdef81f7048a81f8336449cdbf;p=freeside.git diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi index 778cdf2b0..665f5637d 100755 --- a/httemplate/search/cust_main.cgi +++ b/httemplate/search/cust_main.cgi @@ -57,6 +57,7 @@ if ( $cgi->param('browse') ) { my %search = (); + if ( $cgi->param('browse') ) { my $query = $cgi->param('browse'); if ( $query eq 'custnum' ) { @@ -80,15 +81,16 @@ if ( $cgi->param('browse') } else { $sortby = \*last_sort; #?? $orderby = "ORDER BY LOWER(last || ' ' || first)"; #?? - if ( $cgi->param('otaker_on') ) { - $cgi->param('otaker') =~ /^(\w{1,32})$/ or eidiot "Illegal otaker\n"; - $search{otaker} = $1; - } elsif ( $cgi->param('agentnum_on') ) { - $cgi->param('agentnum') =~ /^(\d+)$/ or eidiot "Illegal agentnum\n"; - $search{agentnum} = $1; - } else { - die "unknown query..."; - } + } + + if ( $cgi->param('otaker_on') ) { + $cgi->param('otaker') =~ /^(\w{1,32})$/ or eidiot "Illegal otaker\n"; + $search{otaker} = $1; + } elsif ( $cgi->param('agentnum_on') ) { + $cgi->param('agentnum') =~ /^(\d+)$/ or eidiot "Illegal agentnum\n"; + $search{agentnum} = $1; +# } else { +# die "unknown query..."; } my @qual = (); @@ -285,7 +287,7 @@ if ( scalar(@cust_main) == 1 && ! $cgi->param('referral_custnum') ) { or eidiot "Illegal referral_custnum\n"; my $referral_custnum = $1; my $cust_main = qsearchs('cust_main', { custnum => $referral_custnum } ); - print '
'. + print ''. qq!!. 'referrals of $referral_custnum: ". @@ -398,36 +400,47 @@ END } foreach my $addl_col ( @addl_cols ) { - print ""; + print ""; if ( $addl_col eq 'tickets' ) { if ( @custom_priorities ) { print &itable('', 0); foreach my $priority ( @custom_priorities, '' ) { - my $ahref = - ''; - print "$ahref". - FS::TicketSystem->num_customer_tickets($custnum,$priority). - "". - "$ahref". + + my $num = + FS::TicketSystem->num_customer_tickets($custnum,$priority); + my $ahref = ''; + $ahref= '' + if $num; + + print ''. + " $ahref$num". + "$ahref". ( $priority || '(none)' ). - ""; + ""; + } print ''. - ''; + ''; } - my $ahref = - ''; + + my $ahref = ''; + $ahref = '' + if $cust_main->get($addl_col); + print $ahref. $cust_main->get($addl_col). ''; - print "${ahref}Total" + print "". + "${ahref}Total". + "" if @custom_priorities; + } else { print $cust_main->get($addl_col); } - print ""; + print ""; } my($n1)='';