From: ivan Date: Sat, 1 May 2004 22:49:09 +0000 (+0000) Subject: don't display links to missing customers X-Git-Tag: BEFORE_FINAL_MASONIZE~1119 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=0f5028bc5a7789429a41bca886e5a38ed0fa099f;hp=6e0b2d0a94827df55364a45fe1d1ba8928c5d659 don't display links to missing customers --- diff --git a/httemplate/search/cust_bill.html b/httemplate/search/cust_bill.html index f65b08260..337e9e859 100755 --- a/httemplate/search/cust_bill.html +++ b/httemplate/search/cust_bill.html @@ -50,7 +50,13 @@ } my $link = [ "${p}view/cust_bill.cgi?", 'invnum', ]; - my $clink = [ "${p}view/cust_main.cgi?", 'custnum' ]; + my $clink = sub { + my $cust_bill = shift; + my $cust_main = $cust_bill->cust_main; + $cust_main + ? [ "${p}view/cust_main.cgi?", 'custnum' ] + : ''; + }; %> <%= include( 'elements/search.html', diff --git a/httemplate/search/elements/search.html b/httemplate/search/elements/search.html index 226c4f784..e739afb1d 100644 --- a/httemplate/search/elements/search.html +++ b/httemplate/search/elements/search.html @@ -88,6 +88,7 @@ <% my $a = ''; %> <% if ( $links ) { my $link = shift @$links; + $link = &{$link}($row) if ref($link) eq 'CODE'; if ( $link ) { my( $url, $method ) = @{$link}; if ( ref($method) eq 'CODE' ) {