From: Ivan Kohler Date: Sun, 13 Nov 2016 17:21:59 +0000 (-0800) Subject: don't link to deleted attachments if there aren't any X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=e1e2c5a12697fc16078f46d1e59358de5684ee16 don't link to deleted attachments if there aren't any --- 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 %>)