X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main_note.cgi;h=439c84414c245ed19ce157d6677f304efc16e097;hb=b7c314a198c60a6f9236950994113aa422aa77ff;hp=58ea779a26effae7dfe66019533364c0b80928bd;hpb=2a6aa24137ddd389c1e644f5ece325c5b5dbaf3a;p=freeside.git diff --git a/httemplate/edit/cust_main_note.cgi b/httemplate/edit/cust_main_note.cgi index 58ea779a2..439c84414 100755 --- a/httemplate/edit/cust_main_note.cgi +++ b/httemplate/edit/cust_main_note.cgi @@ -6,11 +6,15 @@ - -

- +% if( $FS::CurrentUser::CurrentUser->option('disable_html_editor') ) { + +% } +% else { +<% include('/elements/htmlarea.html', 'field' => 'comment_html', + 'curr_value' => $comment) %> +% }

"> @@ -20,13 +24,12 @@ <%init> -my($custnum, $comment, $notenum, $action); -$comment = ''; +my $comment; +my $notenum = ''; if ( $cgi->param('error') ) { $comment = $cgi->param('comment'); -}elsif ($cgi->param('notenum')) { - $cgi->param('notenum') =~ /^(\d+)$/; +} elsif ( $cgi->param('notenum') =~ /^(\d+)$/ ) { $notenum = $1; die "illegal query ". $cgi->keywords unless $notenum; my $note = qsearchs('cust_main_note', { 'notenum' => $notenum }); @@ -34,15 +37,15 @@ if ( $cgi->param('error') ) { $comment = $note->comments; } -$cgi->param('notenum') =~ /^(\d+)$/; -$notenum = $1; +$comment =~ s/\r//g; # remove weird line breaks to protect FCKeditor -$cgi->param('custnum') =~ /^(\d+)$/; -$custnum = $1; +$cgi->param('custnum') =~ /^(\d+)$/ or die "illeagl custnum"; +my $custnum = $1; -die "illegal query ". $cgi->keywords unless $custnum; +my $action = $notenum ? 'Edit' : 'Add'; -$action = $notenum ? 'Edit' : 'Add'; +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right("$action customer note");