diff options
author | mark <mark> | 2010-05-24 23:54:58 +0000 |
---|---|---|
committer | mark <mark> | 2010-05-24 23:54:58 +0000 |
commit | b7c314a198c60a6f9236950994113aa422aa77ff (patch) | |
tree | 17d407e55123dd937a90cec197e752e2b79fc4aa | |
parent | 71b3acdcf8c9a6702057bbeecb58d7a685d6c191 (diff) |
RT#8224: allow user to disable HTML editor
-rwxr-xr-x | httemplate/edit/cust_main_note.cgi | 12 | ||||
-rwxr-xr-x | httemplate/edit/process/cust_main_note.cgi | 7 | ||||
-rw-r--r-- | httemplate/pref/pref-process.html | 1 | ||||
-rw-r--r-- | httemplate/pref/pref.html | 9 | ||||
-rwxr-xr-x | httemplate/view/cust_main/notes.html | 2 |
5 files changed, 24 insertions, 7 deletions
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 @@ <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>"> <INPUT TYPE="hidden" NAME="notenum" VALUE="<% $notenum %>"> -<% include('/elements/htmlarea.html', 'field' => 'comment', +% if( $FS::CurrentUser::CurrentUser->option('disable_html_editor') ) { + <TEXTAREA NAME="comment_plain" ROWS="12" COLS="60"><% + join '', split /<br \/>| /, $comment + %></TEXTAREA> +% } +% else { +<% include('/elements/htmlarea.html', 'field' => 'comment_html', 'curr_value' => $comment) %> -% #<TEXTAREA NAME="comment" ROWS="12" COLS="60"> -% # <% $comment %> -% #</TEXTAREA> +% } <BR><BR> <INPUT TYPE="submit" VALUE="<% $notenum ? "Apply Changes" : "Add Note" %>"> diff --git a/httemplate/edit/process/cust_main_note.cgi b/httemplate/edit/process/cust_main_note.cgi index f09189aa9..f904c5968 100755 --- a/httemplate/edit/process/cust_main_note.cgi +++ b/httemplate/edit/process/cust_main_note.cgi @@ -18,12 +18,17 @@ $cgi->param('notenum') =~ /^(\d*)$/ or die "Illegal notenum: ". $cgi->param('notenum'); my $notenum = $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, _date => time, usernum => $FS::CurrentUser::CurrentUser->usernum, - comments => scalar($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 </TR> <TR> - <TH ALIGN="right">Default customer view: </TD> + <TH ALIGN="right">Default customer view: </TH> <TD COLSPAN=2> <SELECT NAME="default_customer_view"> % foreach my $view ( keys %customer_views ) { @@ -53,6 +53,13 @@ Interface </SELECT> </TD> </TR> + + <TR> + <TH ALIGN="right" COLSPAN=1>Disable HTML editor for customer notes: </TH> + <TD ALIGN="left" COLSPAN=2> + <INPUT TYPE="checkbox" NAME="disable_html_editor" VALUE="1" <% $curuser->option('disable_html_editor') ? 'CHECKED' : '' %>> + </TD> + </TR> </TABLE> <BR> diff --git a/httemplate/view/cust_main/notes.html b/httemplate/view/cust_main/notes.html index 74d3f602b..1283b19da 100755 --- a/httemplate/view/cust_main/notes.html +++ b/httemplate/view/cust_main/notes.html @@ -53,7 +53,7 @@ <% $note->usernum ? $note->access_user->name : $note->otaker %> </TD> <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"> - <% $note->comments | defang %> + <% $note->comments | defang %> </TD> % if($edit) { <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $edit %></TD> |