RT#6226: fckeditor for customer notes
authormark <mark>
Tue, 16 Mar 2010 08:37:25 +0000 (08:37 +0000)
committermark <mark>
Tue, 16 Mar 2010 08:37:25 +0000 (08:37 +0000)
httemplate/edit/cust_main_note.cgi
httemplate/elements/htmlarea.html
httemplate/view/cust_main/notes.html

index 6c6a1a9..1fdf0d9 100755 (executable)
@@ -8,9 +8,11 @@
 
 
 <BR><BR>
-<TEXTAREA NAME="comment" ROWS="12" COLS="60">
-<% $comment %>
-</TEXTAREA>
+<% include('/elements/htmlarea.html', 'field' => 'comment',
+                                      'curr_value' => $comment) %>
+% #<TEXTAREA NAME="comment" ROWS="12" COLS="60">
+% # <% $comment %>
+% #</TEXTAREA>
 
 <BR><BR>
 <INPUT TYPE="submit" VALUE="<% $notenum ? "Apply Changes" : "Add Note" %>">
@@ -33,6 +35,8 @@ if ( $cgi->param('error') ) {
   $comment = $note->comments;
 }
 
+$comment =~ s/\r//g; # remove weird line breaks to protect FCKeditor
+
 $cgi->param('custnum') =~ /^(\d+)$/ or die "illeagl custnum";
 my $custnum = $1;
 
index f27c4b5..dca4328 100644 (file)
@@ -24,6 +24,7 @@ Example:
   oFCKeditor.Config['SkinPath'] = '<% $p %>elements/fckeditor/editor/skins/silver/';
   oFCKeditor.Height = '<% $opt{'height'} || 420 %>';
   oFCKeditor.Config['StartupFocus'] = true;
+  oFCKeditor.Config['EnterMode'] = 'br';
 
   oFCKeditor.Create();
 
index 833c92e..a6378f4 100755 (executable)
@@ -11,6 +11,9 @@
 %   }
     <TH CLASS="grid" BGCOLOR="#cccccc">Person</TH>
     <TH CLASS="grid" BGCOLOR="#cccccc">Note</TH>
+%   if ($curuser->access_right('Edit customer note') ) {
+    <TH CLASS="grid" BGCOLOR="#cccccc">&nbsp;</TH>
+%   }
   </TR>
 
 % my $bgcolor1 = '#eeeeee';
@@ -34,7 +37,7 @@
 %                                             ";notenum=$notenum",
 %                            'actionlabel' => 'Edit customer note',
 %                            'width'       => 616,
-%                            'height'      => 408,
+%                            'height'      => 580,
 %                            'frame'       => 'top',
 %                        );
 %   my $clickjs = qq!onclick="$onclick"!;
         &nbsp;<% $note->otaker%>
       </TD>
       <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
-        &nbsp;<%$note->comments%><% $edit %>
+        &nbsp;<%$note->comments%>
       </TD>
+% if($edit) {
+      <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><% $edit %></TD>
+% }
     </TR>
 
 % } #end display notes