customer view UI
[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 % # actually display notes
20 <& notes/notes.html, 'cust_main' => $cust_main &>
21 <BR>
22 % } # end of notes
23
24 % # Attachments
25 % # XXX at some point move all of this into notes/attachments.html
26 % if( $curuser->access_right('View attachments') ) {
27 % # List attachments
28 <& notes/attachments.html, 'cust_main' => $cust_main &>
29 %   if ($cgi->param('show_deleted')) {
30 <A HREF="<% $p.'view/cust_main.cgi?custnum=' . $cust_main->custnum .
31            ($view ? ";show=$view" : '') . '#notes' 
32            %>"><I>(<% mt('Show active attachments') |h %>)</I></A>
33 %   } elsif($curuser->access_right('View deleted attachments')) {
34 <A HREF="<% $p.'view/cust_main.cgi?custnum=' . $cust_main->custnum .
35            ($view ? ";show=$view" : '') . ';show_deleted=1#notes'
36            %>"><I>(<% mt('Show deleted attachments') |h %>)</I></A>
37 %   }
38 % }
39
40 <BR>
41 % if ( $curuser->access_right('View email logs')
42 %      and FS::cust_msg->count("custnum = $custnum")) {
43 <BR>
44 <& notes/email.html, 'cust_main' => $cust_main &>
45 <BR>
46 % }
47 <%init>
48
49 use HTML::Defang;
50
51 my $conf = new FS::Conf;
52 my $curuser = $FS::CurrentUser::CurrentUser;
53
54 my(%opt) = @_;
55
56 my $cust_main = $opt{'cust_main'};
57 my $custnum = $cust_main->custnum;
58
59 my $view =  $cgi->param('show') || $curuser->default_customer_view;
60
61 </%init>