summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/notes.html
blob: ed50c58c23475eca6d6d80be0d515b0540cfbdc8 (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
%
% my $conf = new FS::Conf;
% my $curuser = $FS::CurrentUser::CurrentUser;
%
% $cgi->param('custnum') =~ /^(\d+)$/
%   or die "No customer specified (bad URL)!";
% my $custnum = $1;
%
% my $cust_main = qsearchs('cust_main', {'custnum' => $custnum} );
% die "Custimer not found!" unless $cust_main;
%

<STYLE TYPE="text/css">

body { background: #e8e8e8 }
.inv table { border: none }
.inv TH { border: none }
.inv TD { border: none }

</STYLE>

% my (@notes) = $cust_main->notes();
% if ( scalar(@notes) ) { 

<% include('/elements/init_overlib.html') %>

<TABLE CLASS="inv" CELLSPACING=0 CELLPADDING=0 BORDER=0 >

%   my $bgcolor1 = '#eeeeee';
%   my $bgcolor2 = '#ffffff';
%   my $bgcolor = '';
%
%   foreach my $note (@notes) {
%
%   if ( $bgcolor eq $bgcolor1 ) {
%     $bgcolor = $bgcolor2;
%   } else {
%     $bgcolor = $bgcolor1;
%   }
%
%   my $pop = popurl(3);
%   my $notenum = $note->notenum;
%   my $onclick = include( '/elements/popup_link_onclick.html',
%                            'action'      => popurl(3).
%                                             'edit/cust_main_note.cgi'.
%                                             "?custnum=$custnum".
%                                             ";notenum=$notenum",
%                            'actionlabel' => 'Edit customer note',
%                            'width'       => 616,
%                            'height'      => 408,
%                            'frame'       => 'top',
%                        );
%   my $clickjs = qq!onclick="$onclick"!;
%
%   my ($el, $eel);
%   if ($curuser->access_right('Edit customer note') ) {
%     $el  = qq!<A HREF="javascript:void(0);" $clickjs>!;
%     $eel = qq!</A>!;
%   }else{
%     $el = $eel = '';
%   }

<TR>
  <% note_datestr($note,$conf,$bgcolor, $el, $eel) %>
  <TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
    <% $el %> &nbsp;<%$note->otaker%>&nbsp; <% $eel %>
  </TD>
  <TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
    &nbsp;<%$note->comments%>
  </TD>
</TR>

% } #end display notes

</TABLE>

% } 
%
%#subroutines
%
%sub note_datestr {
% my($note, $conf, $bgcolor, $el, $eel) = @_ or return '';
% my $format=qq{<TD class="inv" bgcolor="$bgcolor" align="left">$el<B>%b</B>$eel</TD>}.
%            qq{<TD class="inv" bgcolor="$bgcolor" align="right">$el<B>&nbsp;%o,</B>$eel</TD>}.
%            qq{<TD class="inv" bgcolor="$bgcolor" align="right">$el<B>&nbsp;%Y&nbsp;</B>$eel</TD>};
% $format .= qq{<TD class="inv" bgcolor="$bgcolor" ALIGN="right">$el<B>&nbsp;%l$eel</TD>}.
%            qq{<TD class="inv" bgcolor="$bgcolor" ALIGN="center">$el<B>:</B>$eel</TD>}.
%            qq{<TD class="inv" bgcolor="$bgcolor" ALIGN="left">$el<B>%M</B>$eel</TD>}.
%            qq{<TD class="inv" bgcolor="$bgcolor" ALIGN="left">$el<B>&nbsp;%P&nbsp;</B>$eel</TD>}
%     if $conf->exists('cust_main_note-display_times');
%   ( my $strip = time2str($format, $note->_date) ) =~ s/ (\d)/$1/g;
%   $strip;
% }
%