Page 1 of 1

Prefill nessage when creating new ticket

Posted: Fri Jul 21, 2023 11:44 pm
by Accustom
Hi,

Which file do I have to edit if i want to prefill the "Message" Textbox for the user, when a new ticket is beeing created?

I guess it would be the index.php, but i struggle getting this "feature" into it.

regards

Re: Prefill nessage when creating new ticket

Posted: Sat Jul 22, 2023 8:11 am
by Klemen
Why not just link to the built-in feature?
https://www.hesk.com/knowledgebase/index.php?article=83

Re: Prefill nessage when creating new ticket

Posted: Sat Jul 22, 2023 10:12 am
by Accustom
Hi. Thank you for your help. I swear I did not find this article, even though I looked for it in the knowledgebase. I guess sometimes it is hard to find the right search-terms in a foreign language.

I can work with that. I hope it does work even for longer (2000+ characters) prefills. :P

Could you point me into the right direction in which file I can find the link for this button ("send ticket"), so i can edit it?

Image


//edit:
though, now that i think about it. It might be better to populate the text-field directly in the code instead of via link (GET, POST), because people might add the "index.php?a=add" as a bookmark. And when i change the prefill in the future, theirs won't be changed.
Would this be possible too?

Re: Prefill nessage when creating new ticket

Posted: Sat Jul 22, 2023 12:21 pm
by Klemen
Might be as simple as finding this in the index.php:

Code: Select all

	if ( isset($_REQUEST['message']) )
	{
		$_SESSION['c_message'] = $_REQUEST['message'];
	}
and adding this below:

Code: Select all

    elseif ( ! isset($_SESSION['c_message'])) {
        $_SESSION['c_message'] = 'Your default message';
    }
Also, note that customizations are out of the scope of our support here; we do try to help with little things here and there, but please consult a PHP developer for help if you need further customizations.

Re: Prefill nessage when creating new ticket

Posted: Tue Jul 25, 2023 3:18 pm
by Accustom
Thank you. I managed it on my own and wanted to post (nearly) the same solution, but the forum was down.

Thank you again! HESK is awesome for family use. :-)