X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fnotes.html;h=c02af386616f6cedd02a3868676340fed93fc1f1;hb=5b2872a065cd65c823e9056b9153e4548ee7c201;hp=f2d11693030b637b4ab59390db50ae395030d8f2;hpb=5e05724a635a22776f1b973f5d7e77989da4e048;p=freeside.git
diff --git a/httemplate/view/cust_main/notes.html b/httemplate/view/cust_main/notes.html
index f2d116930..c02af3866 100755
--- a/httemplate/view/cust_main/notes.html
+++ b/httemplate/view/cust_main/notes.html
@@ -1,93 +1,67 @@
-%
-% my $conf = new FS::Conf;
-% my $curuser = $FS::CurrentUser::CurrentUser;
-%
-% $cgi->param('custnum') =~ /^(\d+)$/
-% or die "No customer specified (bad URL)!";
-% my $custnum = $1;
-%
-% my $cust_main = qsearchs('cust_main', {'custnum' => $custnum} );
-% die "Custimer not found!" unless $cust_main;
-%
-
-
+% # Notes, if any
+
+% my $notecount = scalar($cust_main->notes(0));
+% if ( ! $conf->exists('cust_main-disable_notes') || $notecount) {
-% my (@notes) = $cust_main->notes();
-% if ( scalar(@notes) ) {
+% # actually display notes
+<& notes/notes.html, 'cust_main' => $cust_main &>
+
+% } # end of notes
-
-
-
-
+% # Attachments
+% # XXX at some point move all of this into notes/attachments.html
+% if( $curuser->access_right('View attachments') ) {
+% # List attachments
+<& notes/attachments.html, 'cust_main' => $cust_main &>
+% if ($cgi->param('show_deleted')) {
+">(<% mt('Show active attachments') |h %>)
+% } 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 %>)
+% }
+% }
-
- <% $el %> <%$note->otaker%> <% $eel %> - | -- <%$note->comments%> - | -