I am attempting to mod viewticket.include.php to allow me to add canned responses to Internal Notes, but I am running into an issue.
I have been able to add the drop down box to canned responses to the Internal notes tabber. When I choose one of the canned responses I get the following error pop-up:
"The page at http://mysite.com(http://mysite.com) says:
Cannot handle the AJAX call. Error#0"
I hit Ok to continue and the same error pop-up immediately displays again, so I hit OK again.
Once I hit OK the second time I am able to select any of the canned responses I want and they are added to the text area. I can then submit the Internal Note update and they post to the db correctly.
Below is the code I have changed for the Internal Notes section of viewticket.include.php:
<div id="notes" class="tabbertab" align="left">
<h2>Post Internal Note</h2>
<p>
<form action="tickets.php?id=<?=$id?>#notes" name="notes" class="inline" method="post" enctype="multipart/form-data">
<input type="hidden" name="ticket_id" value="<?=$id?>">
<input type="hidden" name="a" value="postnote">
<div>
<label for="title">Note Title:</label>
<input type="text" name="title" id="title" value="<?=$info?>" size=30px />
</select><font class="error">* <?=$errors?></font></div>
MOD BEGIN CANNED RESPONSE ON INTERNAL NOTES
<div>
<? $sql='SELECT premade_id,title FROM '.KB_PREMADE_TABLE.' WHERE isenabled=1 '.
' AND (dept_id=0 OR dept_id='.db_input($ticket->getDeptId()).')';
$canned=db_query($sql);
if($canned && db_num_rows($canned)) {
?>
Canned Response:
<select id="canned" name="canned"
onChange="getCannedResponse(this.options.value,this.form,'note');this.selectedIndex='0';" >
<option value="0" selected="selected">Select a premade reply</option>
<?while(list($cannedId,$title)=db_fetch_row($canned)) { ?>
<option value="<?=$cannedId?>" ><?=Format:($title)?></option>
<?}?>
</select> <label><input type='checkbox' value='1' name=append checked="true" />Append</label>
<?}?>
</div>
END MOD CANNED RESPONSE ON INTERNAL NOTES
<div style="margin-top: 3px;">
<label for="note" valign="top">Enter note content.
<font class="error">* <?=$errors?></font></label><br/>
<textarea name="note" id="note" cols="80" rows="7" wrap="soft" style="width%"><?=$info?></textarea>
</div>
Any help anyone can give in sorting this out would be GREATLY appreciated.