From: mark Date: Mon, 24 May 2010 23:55:15 +0000 (+0000) Subject: RT#8224: allow user to disable HTML editor X-Git-Tag: freeside_1_9_4~84 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=3e02e34d71a4d29744e90d66377e84f5640b78c4 RT#8224: allow user to disable HTML editor --- diff --git a/httemplate/edit/cust_main_note.cgi b/httemplate/edit/cust_main_note.cgi index e2501cb54..439c84414 100755 --- a/httemplate/edit/cust_main_note.cgi +++ b/httemplate/edit/cust_main_note.cgi @@ -6,11 +6,15 @@ -<% include('/elements/htmlarea.html', 'field' => 'comment', +% if( $FS::CurrentUser::CurrentUser->option('disable_html_editor') ) { + +% } +% else { +<% include('/elements/htmlarea.html', 'field' => 'comment_html', 'curr_value' => $comment) %> -% # +% }

"> diff --git a/httemplate/edit/process/cust_main_note.cgi b/httemplate/edit/process/cust_main_note.cgi index 5127c72d1..5ba8b6032 100755 --- a/httemplate/edit/process/cust_main_note.cgi +++ b/httemplate/edit/process/cust_main_note.cgi @@ -18,6 +18,11 @@ $cgi->param('notenum') =~ /^(\d*)$/ or die "Illegal notenum: ". $cgi->param('notenum'); my $notenum = $1; +my $comment = $cgi->param('comment_html') || + join("
\n", + split "(?:\r|\n)+", $cgi->param('comment_plain') + ); + my $otaker = $FS::CurrentUser::CurrentUser->name; $otaker = $FS::CurrentUser::CurrentUser->username if ($otaker eq "User, Legacy"); @@ -27,7 +32,7 @@ my $new = new FS::cust_main_note ( { custnum => $custnum, _date => time, otaker => $otaker, - comments => $cgi->param('comment'), + comments => $comment, } ); my $error; diff --git a/httemplate/pref/pref-process.html b/httemplate/pref/pref-process.html index 708583df5..47f80afd0 100644 --- a/httemplate/pref/pref-process.html +++ b/httemplate/pref/pref-process.html @@ -44,6 +44,7 @@ unless ( $error ) { # if ($access_user) { #XXX autogen my @paramlist = qw( menu_position default_customer_view + disable_html_editor email_address snom-ip snom-username snom-password vonage-fromnumber vonage-username vonage-password diff --git a/httemplate/pref/pref.html b/httemplate/pref/pref.html index 7ded18377..ab76c3bdc 100644 --- a/httemplate/pref/pref.html +++ b/httemplate/pref/pref.html @@ -40,7 +40,7 @@ Interface - Default customer view: + Default customer view: + + + Disable HTML editor for customer notes: + + option('disable_html_editor') ? 'CHECKED' : '' %>> + +
diff --git a/httemplate/view/cust_main/notes.html b/httemplate/view/cust_main/notes.html index 71511dc93..2b3865475 100755 --- a/httemplate/view/cust_main/notes.html +++ b/httemplate/view/cust_main/notes.html @@ -53,7 +53,7 @@  <% $note->otaker%> -  <%$note->comments%> + <%$note->comments%> % if($edit) { <% $edit %>