summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/notes.html
blob: deba956ae544d3b2d1e6ec1a2d51246052789fe1 (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
% # 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) {

%   unless ( $view eq 'notes' && $cust_main->comments !~ /[^\s\n\r]/ ) {
<P>
  <A NAME="cust_main_note"><FONT SIZE="+2"><% mt('Notes') |h %></FONT></A>
</P>

%   }

%   if ( $curuser->access_right('Add customer note') &&
%        ! $conf->exists('cust_main-disable_notes')
%      ) {

  <& /elements/popup_link-cust_main.html,
                'label'       => emt('Add customer note'),
                'action'      => $p. 'edit/cust_main_note.cgi',
                'actionlabel' => emt('Enter customer note'),
                'cust_main'   => $cust_main,
                'width'       => 616,
                'height'      => 538, #575
  &>

%   }
<BR>

% # 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,
&>
% }

%   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')) {
<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>