Adding the WYSIWYG editor TiynMCE to the ticket interface (creating new / editing tickets and display them correct) is a matter of 2 minutes.
While to add the following changes are not that difficult, if you are firm with editing core files (.php) ask somebody else.
The first - and most important - is, use a qualified editor!
NO MS Word or soemthing else!
Following steps are based on the latest release 2.5.0 of Hesk (maybe works also in earlier, but not tested).
Step 1:
open
../admin/admin_ticket.php and look for the line (around line 125) :
add BEFORE this:
This is to tell the system that the editor shall be loaded (requires to enable the editor for the knowledgebase).
Step 2:
look for (around line 920)
Code: Select all
<p><?php echo $ticket['message']; ?><br /> </p>
and REPLACE with:
Code: Select all
<p><?php echo hesk_html_entity_decode( $ticket['message'] ); ?><br /> </p>
look for (around line 1265)
Code: Select all
<p><?php echo $reply['message']; ?></p>
and REPLACE with:
Code: Select all
<p><?php echo hesk_html_entity_decode( $reply['message'] ); ?></p>
look for (around line 1300):
and ADD AFTER (3 lines below)
this:
Code: Select all
<script type="text/javascript">
/* <![CDATA[ */
tinyMCE.init({
mode : "exact",
elements : "message",
theme : "advanced",
convert_urls : false,
theme_advanced_buttons1 : "cut,copy,paste,|,undo,redo,|,formatselect,fontselect,fontsizeselect,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull",
theme_advanced_buttons2 : "sub,sup,|,charmap,|,bullist,numlist,|,outdent,indent,insertdate,inserttime,preview,|,forecolor,backcolor,|,hr,removeformat,visualaid,|,link,unlink,anchor,image,cleanup,code",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true
});
/* ]]> */
</script>
save this file.
Step 3 (frontend):
To display these HTML messages correct to your customers, following file has to be edited:
../ticket.php
look for (around line 450):
Code: Select all
<p><?php echo $ticket['message']; ?><br /> </p>
and REPLACE with:
Code: Select all
<p><?php echo html_entity_decode( $ticket['message'], ENT_NOQUOTES, 'UTF-8' ); ?><br /> </p>
look for (around line 780):
Code: Select all
<p><?php echo $reply['message']; ?></p>
and REPLACE with:
Code: Select all
<p><?php echo hesk_html_entity_decode( $reply['message'] ); ?></p>
Save this file.
Now the editor is used to edit/create new tickets at the backend - for customers there is still NO editor, too risky (security).
Customer will see their tickets in the frontend created with the editor.
Note: the editor (TinyMCE) is a basic installation (no plugins in a standrad Hesk installation).
To use editor plugins (e.g. embedding images better than the standard way) you have to install these plugins and edit the editor config.
But this is out of scope of this thread.