% $cgi->param('error', $error);
<% $cgi->redirect(popurl(2). 'cust_main_note.cgi?'. $cgi->query_string ) %>
%} else {
-%
<% header('Note ' . ($notenum ? 'updated' : 'added') ) %>
<SCRIPT TYPE="text/javascript">
- parent.cust_main_notes.location.reload();
- try{parent.cust_main_notes.cClick()}
- catch(err){}
- try{parent.cClick()}
- catch(err){}
+ window.top.location.reload();
</SCRIPT>
</BODY></HTML>
-%
% }
<%init>
or die "Illegal notenum: ". $cgi->param('notenum');
my $notenum = $1;
-my $otaker = $FS::CurrentUser::CurrentUser->name;
-$otaker = $FS::CurrentUser::CurrentUser->username
- if ($otaker eq "User, Legacy");
+$cgi->param('classnum') =~ /^(\d*)$/;
+my $classnum = $1;
+
+my $comment = $cgi->param('comment_html') ||
+ join("<br />\n",
+ split "(?:\r|\n)+", $cgi->param('comment_plain')
+ );
my $new = new FS::cust_main_note ( {
notenum => $notenum,
custnum => $custnum,
+ classnum => $classnum ? $classnum : undef,
_date => time,
- otaker => $otaker,
- comments => $cgi->param('comment'),
+ usernum => $FS::CurrentUser::CurrentUser->usernum,
+ comments => $comment,
} );
my $error;