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 %>">
11 <% include('/elements/htmlarea.html', 'field' => 'comment',
12 'curr_value' => $comment) %>
13 % #<TEXTAREA NAME="comment" ROWS="12" COLS="60">
18 <INPUT TYPE="submit" VALUE="<% $notenum ? "Apply Changes" : "Add Note" %>">
28 if ( $cgi->param('error') ) {
29 $comment = $cgi->param('comment');
30 } elsif ( $cgi->param('notenum') =~ /^(\d+)$/ ) {
32 die "illegal query ". $cgi->keywords unless $notenum;
33 my $note = qsearchs('cust_main_note', { 'notenum' => $notenum });
34 die "no such note: ". $notenum unless $note;
35 $comment = $note->comments;
38 $comment =~ s/\r//g; # remove weird line breaks to protect FCKeditor
40 $cgi->param('custnum') =~ /^(\d+)$/ or die "illeagl custnum";
43 my $action = $notenum ? 'Edit' : 'Add';
46 unless $FS::CurrentUser::CurrentUser->access_right("$action customer note");