HESK Custom Field

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
rivera2419
Posts: 2
Joined: Tue Aug 05, 2014 7:56 pm

HESK Custom Field

Post by rivera2419 »

Version of script: 2.4.2 - PHP version: 5.4.30

I've created a custom field named "US Phone Number" in Settings > Custom Field and I checked the "Required" box. The custom field appears with the asterisk (required) on the user side however, from the admin side Home > + New Ticket the custom field appears but it doesn't show as required. How can I make it a required field in "+ New Ticket"?

Thanks in Advance!
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: HESK Custom Field

Post by Klemen »

Fields are not required from admin panel because staff may not always have all the information you can request from a customer.

To make it required, you would need to modify file "admin/admin_submit_ticket.php".

I haven't tested it, but:

1. find line

Code: Select all

$tmpvar[$k]=hesk_makeURL(nl2br(hesk_input($_POST[$k])))
2. find the first else ABOVE that line.
3. ABOVE that "else" add

Code: Select all

		elseif ($v['req'])
        {
        	$tmpvar[$k]=hesk_makeURL(nl2br(hesk_input($_POST[$k])));
            if (!strlen($tmpvar[$k]))
            {
            	$hesk_error_buffer[$k]=$hesklang['fill_all'].': '.$v['name'];
            }
        }
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
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: HESK Custom Field

Post by Klemen »

Also, to show the red asterisk, in "admin/new_ticket.php" replace

Code: Select all

$v['req'] = '';
with

Code: Select all

$v['req'] = $v['req'] ? '<font class="important">*</font>' : ''; 
Twice!
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
rivera2419
Posts: 2
Joined: Tue Aug 05, 2014 7:56 pm

Re: HESK Custom Field

Post by rivera2419 »

Thanks for the prompt reply! I'll give it a try.....
Post Reply