From 0f5028bc5a7789429a41bca886e5a38ed0fa099f Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 1 May 2004 22:49:09 +0000 Subject: [PATCH 1/1] don't display links to missing customers --- httemplate/search/cust_bill.html | 8 +++++++- httemplate/search/elements/search.html | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) 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' ) { -- 2.11.0