7a19f8b3833103556581b9b96e05298c2247d72d
[freeside.git] / httemplate / view / cust_main / notes.html
1 % # Customer comments
2 % if ( $cust_main->comments =~ /[^\s\n\r]/ ) {
3 <BR><% mt('Comments') |h %>
4 <% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %>
5 <TR>
6   <TD BGCOLOR="#ffffff">
7     <PRE><% encode_entities($cust_main->comments) %></PRE>
8   </TD>
9 </TR>
10 </TABLE></TABLE>
11 <BR><BR>
12 % }
13
14 % # Notes, if any
15 <A NAME="notes">
16 % my $notecount = scalar($cust_main->notes(0));
17 % if ( ! $conf->exists('cust_main-disable_notes') || $notecount) {
18
19 %   unless ( $view eq 'notes' && $cust_main->comments !~ /[^\s\n\r]/ ) {
20 <P>
21   <A NAME="cust_main_note"><FONT SIZE="+2"><% mt('Notes') |h %></FONT></A>
22 </P>
23
24 %   }
25
26 <BR>
27
28 % # actually display notes
29 <& notes/notes.html, 'cust_main' => $cust_main &>
30 <BR>
31 % } # end of notes
32
33 % # Attachments
34 % # XXX at some point move all of this into notes/attachments.html
35 % if( $curuser->access_right('View attachments') ) {
36 % # List attachments
37 <& notes/attachments.html, 'cust_main' => $cust_main &>
38 %   if ($cgi->param('show_deleted')) {
39 <A HREF="<% $p.'view/cust_main.cgi?custnum=' . $cust_main->custnum .
40            ($view ? ";show=$view" : '') . '#notes' 
41            %>"><I>(<% mt('Show active attachments') |h %>)</I></A>
42 %   } elsif($curuser->access_right('View deleted attachments')) {
43 <A HREF="<% $p.'view/cust_main.cgi?custnum=' . $cust_main->custnum .
44            ($view ? ";show=$view" : '') . ';show_deleted=1#notes'
45            %>"><I>(<% mt('Show deleted attachments') |h %>)</I></A>
46 %   }
47 % }
48
49 <BR>
50 % if ( $curuser->access_right('View email logs')
51 %      and FS::cust_msg->count("custnum = $custnum")) {
52 <BR>
53 <& notes/email.html, 'cust_main' => $cust_main &>
54 <BR>
55 % }
56 <%init>
57
58 use HTML::Defang;
59
60 my $conf = new FS::Conf;
61 my $curuser = $FS::CurrentUser::CurrentUser;
62
63 my(%opt) = @_;
64
65 my $cust_main = $opt{'cust_main'};
66 my $custnum = $cust_main->custnum;
67
68 my $view =  $cgi->param('show') || $curuser->default_customer_view;
69
70 </%init>