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 <TH CLASS="grid" BGCOLOR="#cccccc">Time</TH>
10 <TH CLASS="grid" BGCOLOR="#cccccc">Person</TH>
11 <TH CLASS="grid" BGCOLOR="#cccccc">Note</TH>
14 % my $bgcolor1 = '#eeeeee';
15 % my $bgcolor2 = '#ffffff';
18 % foreach my $note (@notes) {
20 % if ( $bgcolor eq $bgcolor1 ) {
21 % $bgcolor = $bgcolor2;
23 % $bgcolor = $bgcolor1;
26 % my $pop = popurl(3);
27 % my $notenum = $note->notenum;
28 % my $onclick = include( '/elements/popup_link_onclick.html',
29 % 'action' => popurl(2).
30 % 'edit/cust_main_note.cgi'.
31 % "?custnum=$custnum".
32 % ";notenum=$notenum",
33 % 'actionlabel' => 'Edit customer note',
38 % my $clickjs = qq!onclick="$onclick"!;
41 % if ($curuser->access_right('Edit customer note') ) {
42 % $edit = qq! <A HREF="javascript:void(0);" $clickjs>(edit)</A>!;
46 <% note_datestr($note,$conf,$bgcolor) %>
47 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
48 <% $note->otaker%>
50 <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
51 <%$note->comments%><% $edit %>
55 % } #end display notes
62 my $conf = new FS::Conf;
63 my $curuser = $FS::CurrentUser::CurrentUser;
67 my $custnum = $opt{'custnum'};
69 my $cust_main = qsearchs('cust_main', {'custnum' => $custnum} );
70 die "Custimer not found!" unless $cust_main;
72 my (@notes) = $cust_main->notes();
77 my($note, $conf, $bgcolor) = @_ or return '';
78 my $td = '<TD CLASS="grid" BGCOLOR="$bgcolor" ALIGN="right">';
79 my $format = "$td%b %o, %Y</TD>";
80 $format .= "$td%l:%M%P</TD>"
81 if $conf->exists('cust_main_note-display_times');
82 ( my $strip = time2str($format, $note->_date) ) =~ s/ (\d)/$1/g;