Autofill Portion of Ticket via Link

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
mkoch227
Posts: 666
Joined: Wed Jul 04, 2012 3:37 pm

Autofill Portion of Ticket via Link

Post by mkoch227 »

I am currently working on a client's website, and I would like the users of the site to contact me via HESK if there are any issues with the site. To easily distinguish requests from the client site, I want to autofill the subject line when the user clicks a link to "contact the webmaster" (me). Is there any way I can modify the link so that a portion of the ticket is "pre-filled" for the user?
Mike, Lead Developer of Image HESK: A surprisingly simple, user-friendly and FREE help desk software with integrated knowledgebase.
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: Autofill Portion of Ticket via Link

Post by Klemen »

You could do that with a small modification:

1. send message using a query string, for example by adding "&subject=Test" to the URL
2. make HESK check if the subject parameter is set.
3. If yes, define a session variable with the subject

In other words:

1. open index.php
2. just BELOW this code

Code: Select all

define('AUTOFOCUS', true);
add something like

Code: Select all

		if ( ! empty($_GET['subject']) )
		{
			$_SESSION['c_subject'] = stripslashes(hesk_input( hesk_GET('subject') ));
		}
3. call your help desk like this:

Code: Select all

http://site.com/hesk/index.php?a=add&subject=Test
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
nklapper
Posts: 1
Joined: Sat Jul 19, 2014 2:17 pm

Re: Autofill Portion of Ticket via Link

Post by nklapper »

The above is almost exactly what I need. However, what I need to do is auto-fill a few Custom Fields.

Could you please explain how to target these fields instead of "c_subject"?
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: Autofill Portion of Ticket via Link

Post by Klemen »

You would use "c_custom1", "c_custom2",... up to "c_custom_20" instead.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Post Reply