Page 1 of 1

Hide Category From Customer

Posted: Sun Sep 09, 2012 4:03 pm
by DUMONTTF
Hello,


I swear I browsed the forums looking for a reply before coming to you for help. I also acknowledge that you don't provide support for editing code in Hesk. Still, I thought I'd give it a shot and hope someone in the forums has a quick fix for this.


Here's the thing: I'd like to hide the category field from the customers when submitting a ticket and have it auto-assigned by the direct link to that category.


Can this be done?



Thanks in advance,
Tiago

Re: Hide Category From Customer

Posted: Sun Sep 09, 2012 4:43 pm
by Klemen
Something like this should work:

1. Open index.php in a text editor

2. find this code

Code: Select all

    if (hesk_dbNumRows($res) == 1)
    {
    	/* Only 1 public category, no need for select box */
    	$row = hesk_dbFetchAssoc($res);
		echo '<input type="hidden" name="category" value="'.$row['id'].'" />';
    }
3. just BELOW add this

Code: Select all

    elseif ( ! empty($_GET['catid']) )
    {
		echo '<input type="hidden" name="category" value="'.intval($_GET['catid']).'" />';
    }
4. Save, upload and test!

Re: Hide Category From Customer

Posted: Sun Sep 09, 2012 4:54 pm
by DUMONTTF
Absolutely perfect!

Thank you so much!