Page 1 of 1
Hiding a customized field from end user eyes
Posted: Thu Sep 23, 2010 10:49 pm
by huogas
Hello
Is it possible to hide a (one or many) customized field(s) from the end users ?
Thanks
Gaston
Re: Hiding a customized field from end user eyes
Posted: Fri Sep 24, 2010 8:23 am
by Klemen
Open ticket.php in notepad and find
and change it to
Code: Select all
$v['use'] && $v['place']==0 && !in_array($k,array('custom1','custom2','custom3'))
Similarly change
to
Code: Select all
$v['use'] && $v['place'] && !in_array($k,array('custom1','custom2','custom3'))
This should hide the first, second and third custom field from the customer. You can change the list by modifying 'custom1', 'custom2','custom3'.
Re: Hiding a customized field from end user eyes
Posted: Fri Sep 24, 2010 11:40 am
by huogas
Hello
Doesn't seem to make it.
Just to make sure, the targeted page was the one used by a end user to submit a ticket (submit_ticket.php).
"
http://domain.com/hesk/index.php?a=add&language=English"
Gaston
Re: Hiding a customized field from end user eyes
Posted: Sat Sep 25, 2010 9:39 am
by Klemen
Wait, you don't even want the customer to enter anything in custom fields when submitting a ticket?
Or do you want the customer to enter the details but not be able to see them afterwards?
Re: Hiding a customized field from end user eyes
Posted: Sat Sep 25, 2010 11:14 am
by huogas
I want to be able to mark some custom fields as "internal". I mean that those fields won't appears in any client pages, essentially the page used to submit a new ticket and the page used to see the status of a request. "Not internal" (or public) fields would be accessible on these pages.
Sorry if I was not clear.
Gaston
Re: Hiding a customized field from end user eyes
Posted: Sat Sep 25, 2010 5:36 pm
by Klemen
Try modifying the same code in the index.php - so you have that code modified in both index.php and ticket.php
Re: Hiding a customized field from end user eyes
Posted: Sun Sep 26, 2010 11:58 am
by huogas
What was doing the modification in index.php ?
Gaston
Re: Hiding a customized field from end user eyes
Posted: Sun Sep 26, 2010 1:52 pm
by Klemen
Should be the same code in both files (the code I posted few replies back).
In index.php it will hide the fields from the "submit a ticket" form and in ticket.php it will hide the fields when the customer is looking at the ticket.
Re: Hiding a customized field from end user eyes
Posted: Sun Sep 26, 2010 2:55 pm
by huogas
That works perfectly

. Don't you think it should become a feature (a custom field being marked as hidden ?
Thanks
Gaston
Re: Hiding a customized field from end user eyes
Posted: Sun Sep 26, 2010 3:07 pm
by Klemen
Already added on my "to do" list for version 2.3

Re: Hiding a customized field from end user eyes
Posted: Thu Apr 14, 2011 9:26 pm
by manny
Hi,
I have followed the above directions but can't seem to get it to work. After I apply the changes to both index.php and ticket.php, I get a white page? Any ideas why?
Here is what I inputted.
if ($v['use'] && $v['place']==0 && !in_array($k,array('custom3'))
if ($v['use'] && $v['place'] && !in_array($k,array('custom3'))
Re: Hiding a customized field from end user eyes
Posted: Fri Apr 15, 2011 2:16 pm
by Klemen
You get an error probably because you have PHP syntax error in the edited files. Try enabling debug mode in admin panel and see if you get any error messages then.
Also note that 'custom3' should be changed to the custom field number you wish to hide.
Re: Hiding a customized field from end user eyes
Posted: Fri Aug 19, 2011 12:34 pm
by AKNL
I need this function too...only thing left is to edit it outside of the post itself...like in the main admin somehwere.
Dont need to click like 4 times before i can edit the field.