Page 1 of 1

[solved] How to make attachment to be required?

Posted: Wed Mar 26, 2014 6:45 am
by memz
Hi,

I am new using Hesk but I really love this stuff because can really help my work. :)

I've problem, in my case I wanna make attachment to be required because it can help me to do my support to users. Can you help me with my case? I'm using HESK 2.5.3. Thanks.

Re: How to make attachment to be required?

Posted: Thu Mar 27, 2014 8:02 am
by memz
I already add in tetx.php to define what message that would appear if attachment not loaded and add the "asteric" sign to make "Attachment" to be important in index.php. But I didn't know where I should add hesk_error_buffer in submit_ticket.php.

Sould I edit this code ?

Code: Select all

// Attachments
	
	if ($hesk_settings['attachments']['use'])
	{
	    require_once(HESK_PATH . 'inc/attachments.inc.php');

	    $attachments = array();
        $trackingID  = $tmpvar['trackid'];
		
		for ($i = 1; $i <= $hesk_settings['attachments']['max_number']; $i++)
	    {
	        $att = hesk_uploadFile($i);
	        if ($att !== false && ! empty($att) )
	        {
	            $attachments[$i] = $att;
	        }
	    }
		
	}
	$tmpvar['attachments'] = '';
Is anyone can help me?

Thanks.

Re: How to make attachment to be required?

Posted: Thu Mar 27, 2014 3:40 pm
by Klemen
Add the end you could try something like

Code: Select all

if ( count($attachments) == 0 )
{
// error buffer here
}

Re: How to make attachment to be required?

Posted: Wed Apr 02, 2014 2:25 am
by memz
Great..it works now..Thanks for the support. :)

Re: [solved] How to make attachment to be required?

Posted: Wed Jan 31, 2024 12:56 am
by Profi4You
Hello everyone!
I met with a similar task on HESK 3.4.3, everything was solved with the help of a hint from Klemen. Thank you very much!
If someone is interested in the solution, I can post it here.
Everyone have a good day!

Re: [solved] How to make attachment to be required?

Posted: Wed Jan 31, 2024 1:02 pm
by Klemen
Sure, feel free to share.

Re: [solved] How to make attachment to be required?

Posted: Thu Feb 01, 2024 4:58 pm
by shddcit
Profi4You wrote: Wed Jan 31, 2024 12:56 am Hello everyone!
I met with a similar task on HESK 3.4.3, everything was solved with the help of a hint from Klemen. Thank you very much!
If someone is interested in the solution, I can post it here.
Everyone have a good day!
Of course, many of us are interested in this, lay it out. I'll be glad. There is the same need, because employees usually write unrealistic nonsense in the text of the message.