X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fcust_main_note.cgi;h=e2501cb54848abbdaa9f8813d53bcf93957eceb0;hb=20f38e4c256094bd938b732950e8f93319f851a5;hp=303895bd8366a2f72a9bfdb7bcacfa671f15cc38;hpb=576c6b48428aa95e0fd80db011fe73c0b728c88b;p=freeside.git diff --git a/httemplate/edit/cust_main_note.cgi b/httemplate/edit/cust_main_note.cgi index 303895bd8..e2501cb54 100755 --- a/httemplate/edit/cust_main_note.cgi +++ b/httemplate/edit/cust_main_note.cgi @@ -1,19 +1,16 @@ <% include('/elements/header-popup.html', "$action Customer Note") %> -% if ( $cgi->param('error') ) { - Error: <% $cgi->param('error') %> -

-% } +<% include('/elements/error.html') %>
- -

- +<% include('/elements/htmlarea.html', 'field' => 'comment', + 'curr_value' => $comment) %> +% #

"> @@ -23,13 +20,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 }); @@ -37,15 +33,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");