Page 1 of 1
Admin Reply
Posted: Tue Dec 29, 2009 3:53 pm
by mvraven
/*************************************
Title:
Version:
Author:
Demo:
Download:
Website:
Short description:
Add in admin reply short clicks like %%HESK_NAME%% like in canned reply's.
*************************************/
When you make an canned reply there is a possibility to click on links that make a formfield into the text what is typed into the form when a client fills it in like %%HESK_NAME%% will change into the name when send.
Now i would like that same posibility when i make a reply on a new ticket into the admin section. How is that possible?
Posted: Wed Jan 27, 2010 11:38 am
by mvraven
Someone?
Re: Admin Reply
Posted: Wed Jan 27, 2010 9:26 pm
by Petert
mvraven wrote:
Add in admin reply short clicks like %%HESK_NAME%% like in canned reply's.
Copied some stuff from the manage_canned.php file and made it work, see screenshot

Posted: Thu Jan 28, 2010 3:33 pm
by mvraven
How have you done that? What have you copied and where have you placed that?
Posted: Fri Jan 29, 2010 6:08 pm
by Petert
mvraven wrote:How have you done that? What have you copied and where have you placed that?
at around line number 773 in admin_ticket.php add:
Code: Select all
<!-- 27012010 T -->
<script language="javascript" type="text/javascript"><!--
function confirm_delete()
{
if (confirm('<?php echo $hesklang['delete_saved']; ?>')) {return true;}
else {return false;}
}
function hesk_insertTag(tag) {
var text_to_insert = '%%'+tag+'%%';
hesk_insertAtCursor(document.form1.message, text_to_insert);
document.form1.message.focus();
}
function hesk_insertAtCursor(myField, myValue) {
if (document.selection) {
myField.focus();
sel = document.selection.createRange();
sel.text = myValue;
}
else if (myField.selectionStart || myField.selectionStart == '0') {
var startPos = myField.selectionStart;
var endPos = myField.selectionEnd;
myField.value = myField.value.substring(0, startPos)
+ myValue
+ myField.value.substring(endPos, myField.value.length);
} else {
myField.value += myValue;
}
}
//-->
</script>
<br/><?php echo $hesklang['insert_special']; ?>:<br />
<a href="javascript:void(0)" onclick="hesk_insertTag('HESK_NAME')"><?php echo $hesklang['name']; ?></a> |
<a href="javascript:void(0)" onclick="hesk_insertTag('HESK_EMAIL')"><?php echo $hesklang['email']; ?></a>
<?php
foreach ($hesk_settings['custom_fields'] as $k=>$v)
{
if ($v['use'])
{
echo '| <a href="javascript:void(0)" onclick="hesk_insertTag(\'HESK_'.$k.'\')">'.$v['name'].'</a> ';
}
}
?>
</p>
<!-- /27012010 T -->
That's it (or use the admin_ticket.php file I attached)
edit: I can't attach files, PM me for a zip file