Page 1 of 1

HESK Custom Field

Posted: Tue Aug 05, 2014 8:12 pm
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!

Re: HESK Custom Field

Posted: Tue Aug 05, 2014 8:40 pm
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'];
            }
        }

Re: HESK Custom Field

Posted: Tue Aug 05, 2014 8:42 pm
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!

Re: HESK Custom Field

Posted: Tue Aug 05, 2014 9:11 pm
by rivera2419
Thanks for the prompt reply! I'll give it a try.....