1 % if ( scalar(@notes) ) {
3 <% include('/elements/init_overlib.html') %>
5 <% include("/elements/table-grid.html") %>
8 <TH CLASS="grid" BGCOLOR="#cccccc">Date</TH>
9 % if ( $conf->exists('cust_main_note-display_times') ) {
10 <TH CLASS="grid" BGCOLOR="#cccccc">Time</TH>
12 <TH CLASS="grid" BGCOLOR="#cccccc">Person</TH>
13 <TH CLASS="grid" BGCOLOR="#cccccc">Note</TH>
14 % if ($curuser->access_right('Edit customer note') ) {
15 <TH CLASS="grid" BGCOLOR="#cccccc"> </TH>
19 % my $bgcolor1 = '#eeeeee';
20 % my $bgcolor2 = '#ffffff';
23 % foreach my $note (@notes) {
25 % if ( $bgcolor eq $bgcolor1 ) {
26 % $bgcolor = $bgcolor2;
28 % $bgcolor = $bgcolor1;
31 % my $pop = popurl(3);
32 % my $notenum = $note->notenum;
33 % my $onclick = include( '/elements/popup_link_onclick.html',
34 % 'action' => popurl(2).
35 % 'edit/cust_main_note.cgi'.
36 % "?custnum=$custnum".
37 % ";notenum=$notenum",
38 % 'actionlabel' => 'Edit customer note',
40 % 'height' => 538, #575
43 % my $clickjs = qq!onclick="$onclick"!;
46 % if ($curuser->access_right('Edit customer note') ) {
47 % $edit = qq! <A HREF="javascript:void(0);" $clickjs>(edit)</A>!;
51 <% note_datestr($note,$conf,$bgcolor) %>
52 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
53 <% $note->otaker%>
55 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
56 <% $note->comments | defang %>
59 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $edit %></TD>
63 % } #end display notes
72 my $conf = new FS::Conf;
73 my $curuser = $FS::CurrentUser::CurrentUser;
77 my $custnum = $opt{'custnum'};
79 my $cust_main = qsearchs('cust_main', {'custnum' => $custnum} );
80 die "Custimer not found!" unless $cust_main;
82 my (@notes) = $cust_main->notes();
87 my($note, $conf, $bgcolor) = @_ or return '';
88 my $td = qq{<TD CLASS="grid" BGCOLOR="$bgcolor" ALIGN="right">};
89 my $format = "$td%b %o, %Y</TD>";
90 $format .= "$td%l:%M%P</TD>"
91 if $conf->exists('cust_main_note-display_times');
92 ( my $strip = time2str($format, $note->_date) ) =~ s/ (\d)/$1/g;