From e1e2c5a12697fc16078f46d1e59358de5684ee16 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sun, 13 Nov 2016 09:21:59 -0800 Subject: [PATCH] don't link to deleted attachments if there aren't any --- httemplate/view/cust_main/notes.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/httemplate/view/cust_main/notes.html b/httemplate/view/cust_main/notes.html index 62502002e..c02af3866 100755 --- a/httemplate/view/cust_main/notes.html +++ b/httemplate/view/cust_main/notes.html @@ -30,7 +30,13 @@ ">(<% mt('Show active attachments') |h %>) -% } elsif($curuser->access_right('View deleted attachments')) { +% } elsif ( $curuser->access_right('View deleted attachments') +% && FS::Record->scalar_sql( +% 'SELECT 1 FROM cust_attachment WHERE custnum = ? '. +% ' AND disabled IS NOT NULL AND disabled > 0 LIMIT 1', +% $custnum ) +% ) +% { ">(<% mt('Show deleted attachments') |h %>) -- 2.11.0