summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/notes.html
blob: c02af386616f6cedd02a3868676340fed93fc1f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
% # Customer comments
% if ( $cust_main->comments =~ /[^\s\n\r]/ ) {
<BR><% mt('Comments') |h %>
<% ntable("#cccccc") %><TR><TD><% ntable("#cccccc",2) %>
<TR>
  <TD BGCOLOR="#ffffff">
    <PRE><% encode_entities($cust_main->comments) %></PRE>
  </TD>
</TR>
</TABLE></TABLE>
<BR><BR>
% }

% # Notes, if any
<A NAME="notes">
% my $notecount = scalar($cust_main->notes(0));
% if ( ! $conf->exists('cust_main-disable_notes') || $notecount) {

% # 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 &>
%   if ($cgi->param('show_deleted')) {
<A HREF="<% $p.'view/cust_main.cgi?custnum=' . $cust_main->custnum .
           ($view ? ";show=$view" : '') . '#notes' 
           %>"><I>(<% mt('Show active attachments') |h %>)</I></A>
%   } 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 )
%           )
%   {
<A HREF="<% $p.'view/cust_main.cgi?custnum=' . $cust_main->custnum .
           ($view ? ";show=$view" : '') . ';show_deleted=1#notes'
           %>"><I>(<% mt('Show deleted attachments') |h %>)</I></A>
%   }
% }

<BR>
% if ( $curuser->access_right('View email logs')
%      and FS::cust_msg->count("custnum = $custnum")) {
<BR>
<& notes/email.html, 'cust_main' => $cust_main &>
<BR>
% }
<%init>

use HTML::Defang;

my $conf = new FS::Conf;
my $curuser = $FS::CurrentUser::CurrentUser;

my(%opt) = @_;

my $cust_main = $opt{'cust_main'};
my $custnum = $cust_main->custnum;

my $view =  $cgi->param('show') || $curuser->default_customer_view;

</%init>