diff options
author | mark <mark> | 2010-05-24 23:55:15 +0000 |
---|---|---|
committer | mark <mark> | 2010-05-24 23:55:15 +0000 |
commit | 3e02e34d71a4d29744e90d66377e84f5640b78c4 (patch) | |
tree | d85faa05c61792e2dea9cff77b36d245a38b36c1 | |
parent | 63dbb8aa310e48efc0ceff2c3b8f47ea8dd07a8e (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 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("<br />\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 </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 71511dc93..2b3865475 100755 --- a/httemplate/view/cust_main/notes.html +++ b/httemplate/view/cust_main/notes.html @@ -53,7 +53,7 @@ <% $note->otaker%> </TD> <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"> - <%$note->comments%> + <%$note->comments%> </TD> % if($edit) { <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $edit %></TD> |