1 <% include('/elements/header-popup.html', "$action Customer Note") %>
3 <% include('/elements/error.html') %>
5 <FORM ACTION="<% popurl(1) %>process/cust_main_note.cgi" METHOD=POST>
6 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
7 <INPUT TYPE="hidden" NAME="notenum" VALUE="<% $notenum %>">
9 % if( $FS::CurrentUser::CurrentUser->option('disable_html_editor') ) {
10 <TEXTAREA NAME="comment_plain" ROWS="12" COLS="60"><%
11 join '', split /<br \/>| /, $comment
15 <% include('/elements/htmlarea.html', 'field' => 'comment_html',
16 'curr_value' => $comment) %>
20 <INPUT TYPE="submit" VALUE="<% $notenum ? "Apply Changes" : "Add Note" %>">
30 if ( $cgi->param('error') ) {
31 $comment = $cgi->param('comment');
32 } elsif ( $cgi->param('notenum') =~ /^(\d+)$/ ) {
34 die "illegal query ". $cgi->keywords unless $notenum;
35 my $note = qsearchs('cust_main_note', { 'notenum' => $notenum });
36 die "no such note: ". $notenum unless $note;
37 $comment = $note->comments;
40 $comment =~ s/\r//g; # remove weird line breaks to protect FCKeditor
42 $cgi->param('custnum') =~ /^(\d+)$/ or die "illeagl custnum";
45 my $action = $notenum ? 'Edit' : 'Add';
48 unless $FS::CurrentUser::CurrentUser->access_right("$action customer note");