Admin Reply

Everything related to Hesk - helpdesk software

Moderator: mkoch227

Post Reply
mvraven
Posts: 32
Joined: Mon Nov 30, 2009 3:34 pm

Admin Reply

Post 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?
mvraven
Posts: 32
Joined: Mon Nov 30, 2009 3:34 pm

Post by mvraven »

Someone?
Petert
Posts: 26
Joined: Sun Jan 10, 2010 10:10 pm

Re: Admin Reply

Post 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

Image
mvraven
Posts: 32
Joined: Mon Nov 30, 2009 3:34 pm

Post by mvraven »

How have you done that? What have you copied and where have you placed that?
Petert
Posts: 26
Joined: Sun Jan 10, 2010 10:10 pm

Post 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
Post Reply