Display only certain custom fields?

Everything related to Hesk - helpdesk software

Moderator: mkoch227

Post Reply
SS113
Posts: 27
Joined: Mon Aug 15, 2011 1:27 pm

Display only certain custom fields?

Post by SS113 »

Hello,

Is there any way for me to display only part of the custom fields?

For example:

I have custom fields:
A, B, C, D

Right now as I see it no matter what, all of them will display from A to D on a form. What if i want to only display A and B based on the form they are on? Then C and D will display on a different form?

When I say form I mean one form will be for customers to fill out and the other will be from the admin panel just like we have ticket.php in root folder and then we have new_ticket.php in admin folder.

Thank for any help!
Klemen
Site Admin
Posts: 10136
Joined: Fri Feb 11, 2005 4:04 pm

Re: Display only certain custom fields?

Post by Klemen »

You would have to manually modify the forms to achieve that. Don't forget to backup first.

For example in index.php find

Code: Select all

$v['use']
(twice) and change it to something like

Code: Select all

$v['use'] && ! in_array($v['name'], array('Custom field 1','Custom filed 3') )
This should not print out fields named "Custom field 1" and "Custom field 2". Names must exactly match names of your custom fields.

Or if you prefer to use custom field numbers (maybe better - this way if you change name it still won't show 1st and 3rd custom field):

Code: Select all

$v['use'] && ! in_array($k, array('custom1','custom3') )
Also make sure these fields aren't required or the customer would be getting a "required fields missing" error.
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
SS113
Posts: 27
Joined: Mon Aug 15, 2011 1:27 pm

Re: Display only certain custom fields?

Post by SS113 »

Great Klemen! Thank you very much for the quick reply!

I'll let you know if I bump into any problems but sounds pretty straight forward!

Thanks
Post Reply