From: Ivan Kohler Date: Sun, 13 Nov 2016 17:22:02 +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=60f03007647bdd937354846c83f33475abe1f150 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 %>)