- <TR>
- <% note_datestr($note,$conf,$bgcolor) %>
- <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
- <% $note->usernum ? $note->access_user->name : $note->otaker %>
- </TD>
- <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
- <% $note->comments | defang %>
- </TD>
-% if($edit) {
- <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $edit %></TD>
+% # actually display notes
+<& notes/notes.html, 'cust_main' => $cust_main &>
+<BR>
+% } # 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 &>
+% # "Attach file" link
+% if(! $conf->config('disable_cust_attachment')
+% and $curuser->access_right('Add attachment')) {
+<& /elements/popup_link-cust_main.html,
+ 'label' => emt('Attach file'),
+ 'action' => $p.'edit/cust_main_attach.cgi',
+ 'actionlabel' => emt('Upload file'),
+ 'cust_main' => $cust_main,
+ 'width' => 480,
+ 'height' => 296,
+&>