The problem with the canned responses is that the selects onchange event is pointed at your textarea, which no longer exists after the javascript for CKEditor takes over. I can get it to almost work by replacing the selects onchange event to..
onChange="getCannedResponse(this.options.value,this.form,'response');this.selectedIndex='0';CKEDITOR.instances.response.setData();
BUT......you have to click the entry twice to get it to display in the editor, and it still acts kinda crazy after that. It seems like the first click is storing the data somewhere, then the second click is actually posting it to the editor. I'm trying to figure it out.
To get HTML from the client side to display properly in viewticket.inc.php youll need to add some more code...
Giving your clients access to DOMDocument() is extremely dangerous. I accept no responsibility if someone takes advantage of this fact.
Find the code...
//get messages
also find the code...
//get answers for messages
BETWEEN those two, make the code like this...
$sql='SELECT msg.msg_id,msg.created,msg.message,count(attach_id) as attachments FROM '.TICKET_MESSAGE_TABLE.' msg '.
' LEFT JOIN '.TICKET_ATTACHMENT_TABLE." attach ON msg.ticket_id=attach.ticket_id AND msg.msg_id=attach.ref_id AND ref_type='M' ".
' WHERE msg.ticket_id='.db_input($id).
' GROUP BY msg.msg_id ORDER BY created';
$msgres =db_query($sql);
while ($msg_row = db_fetch_array($msgres)) {
?>
<table align="center" class="message" cellspacing="0" cellpadding="1" width="100%" border=0>
<tr><th><?=Format:($msg_row)?> - <?=Format:($ticket->getName())?> </th></tr>
<?if($msg_row>0){ ?>
<tr class="header"><td><?=$ticket->getAttachmentStr($msg_row,'M')?></td></tr>
<?}?>
<tr><td>
<?php
$doc = new DOMDocument();
$doc->loadHTML($msg_row);
echo $doc->saveHTML();
?>
</td></tr>
</table>
<?
GOOD LUCK! :