%
% my $conf = new FS::Conf;
+% my $curuser = $FS::CurrentUser::CurrentUser;
%
% $cgi->param('custnum') =~ /^(\d+)$/
% or die "No customer specified (bad URL)!";
% my $cust_main = qsearchs('cust_main', {'custnum' => $custnum} );
% die "Custimer not found!" unless $cust_main;
%
-% my (@notes) = $cust_main->notes();
-% if ( scalar(@notes) ) {
<STYLE TYPE="text/css">
</STYLE>
+% my (@notes) = $cust_main->notes();
+% if ( scalar(@notes) ) {
+
+<% include('/elements/init_overlib.html') %>
+
<TABLE CLASS="inv" CELLSPACING=0 CELLPADDING=0 BORDER=0 >
-%#<% include('/elements/table-grid.html') %>
% my $bgcolor1 = '#eeeeee';
% my $bgcolor2 = '#ffffff';
% my $bgcolor = '';
% $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) %>
+ <% note_datestr($note,$conf,$bgcolor, $el, $eel) %>
<TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
- <%$note->otaker%>
+ <% $el %> <%$note->otaker%> <% $eel %>
</TD>
<TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
<%$note->comments%>
% } #end display notes
</TABLE>
-% } else {
-<BR>
% }
%
%#subroutines
%
%sub note_datestr {
-% my($note, $conf, $bgcolor) = @_ or return '';
-% my $format=qq{<TD class="inv" bgcolor="$bgcolor" align="left"><B>%b</B></TD>}.
-% qq{<TD class="inv" bgcolor="$bgcolor" align="right"><B> %o,</B></TD>}.
-% qq{<TD class="inv" bgcolor="$bgcolor" align="right"><B> %Y </B></TD>};
-% $format .= qq{<TD class="inv" bgcolor="$bgcolor" ALIGN="right"><B> %l</TD>}.
-% qq{<TD class="inv" bgcolor="$bgcolor" ALIGN="center"><B>:</B></TD>}.
-% qq{<TD class="inv" bgcolor="$bgcolor" ALIGN="left"><B>%M</B></TD>}.
-% qq{<TD class="inv" bgcolor="$bgcolor" ALIGN="left"><B> %P </B></TD>}
+% 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> %o,</B>$eel</TD>}.
+% qq{<TD class="inv" bgcolor="$bgcolor" align="right">$el<B> %Y </B>$eel</TD>};
+% $format .= qq{<TD class="inv" bgcolor="$bgcolor" ALIGN="right">$el<B> %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> %P </B>$eel</TD>}
% if $conf->exists('cust_main_note-display_times');
% ( my $strip = time2str($format, $note->_date) ) =~ s/ (\d)/$1/g;
% $strip;