diff options
author | ivan <ivan> | 2004-05-01 22:49:09 +0000 |
---|---|---|
committer | ivan <ivan> | 2004-05-01 22:49:09 +0000 |
commit | 0f5028bc5a7789429a41bca886e5a38ed0fa099f (patch) | |
tree | 8b6a7055d4347bbad48ca6f0b8a1a75171a27be2 /httemplate | |
parent | 6e0b2d0a94827df55364a45fe1d1ba8928c5d659 (diff) |
don't display links to missing customers
Diffstat (limited to 'httemplate')
-rwxr-xr-x | httemplate/search/cust_bill.html | 8 | ||||
-rw-r--r-- | httemplate/search/elements/search.html | 1 |
2 files changed, 8 insertions, 1 deletions
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' ) { |