2 % if ( $cust_main->comments =~ /[^\s\n\r]/ ) {
3 <BR><% mt('Comments') |h %>
4 <% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %>
7 <PRE><% encode_entities($cust_main->comments) %></PRE>
16 % my $notecount = scalar($cust_main->notes(0));
17 % if ( ! $conf->exists('cust_main-disable_notes') || $notecount) {
19 % unless ( $view eq 'notes' && $cust_main->comments !~ /[^\s\n\r]/ ) {
21 <A NAME="cust_main_note"><FONT SIZE="+2"><% mt('Notes') |h %></FONT></A>
26 % if ( $curuser->access_right('Add customer note') &&
27 % ! $conf->exists('cust_main-disable_notes')
30 <& /elements/popup_link-cust_main.html,
31 'label' => emt('Add customer note'),
32 'action' => $p. 'edit/cust_main_note.cgi',
33 'actionlabel' => emt('Enter customer note'),
34 'cust_main' => $cust_main,
42 % # actually display notes
43 <& notes/notes.html, 'cust_main' => $cust_main &>
48 % # XXX at some point move all of this into notes/attachments.html
49 % if( $curuser->access_right('View attachments') ) {
51 <& notes/attachments.html, 'cust_main' => $cust_main &>
52 % # "Attach file" link
53 % if(! $conf->config('disable_cust_attachment')
54 % and $curuser->access_right('Add attachment')) {
55 <& /elements/popup_link-cust_main.html,
56 'label' => emt('Attach file'),
57 'action' => $p.'edit/cust_main_attach.cgi',
58 'actionlabel' => emt('Upload file'),
59 'cust_main' => $cust_main,
65 % if ($cgi->param('show_deleted')) {
66 <A HREF="<% $p.'view/cust_main.cgi?custnum=' . $cust_main->custnum .
67 ($view ? ";show=$view" : '') . '#notes'
68 %>"><I>(<% mt('Show active attachments') |h %>)</I></A>
69 % } elsif($curuser->access_right('View deleted attachments')) {
70 <A HREF="<% $p.'view/cust_main.cgi?custnum=' . $cust_main->custnum .
71 ($view ? ";show=$view" : '') . ';show_deleted=1#notes'
72 %>"><I>(<% mt('Show deleted attachments') |h %>)</I></A>
77 % if ( $curuser->access_right('View email logs')
78 % and FS::cust_msg->count("custnum = $custnum")) {
80 % if (!$cgi->param('order_by')) {
81 % my $order_by = '_date';
82 % $order_by .= ' DESC' if $curuser->option('history_order') eq 'newest';
83 % $cgi->param('order_by', $order_by);
85 <& /search/cust_msg.html,
87 html_init => mt('Mail sent to this customer: '),
94 my $conf = new FS::Conf;
95 my $curuser = $FS::CurrentUser::CurrentUser;
99 my $cust_main = $opt{'cust_main'};
100 my $custnum = $cust_main->custnum;
102 my $view = $cgi->param('show') || $curuser->default_customer_view;