[solved] How to make attachment to be required?

Everything related to Hesk - helpdesk software

Moderator: mkoch227

Post Reply
memz
Posts: 3
Joined: Wed Mar 26, 2014 5:18 am

[solved] How to make attachment to be required?

Post 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.
Last edited by memz on Wed Apr 02, 2014 2:28 am, edited 1 time in total.
memz
Posts: 3
Joined: Wed Mar 26, 2014 5:18 am

Re: How to make attachment to be required?

Post 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.
Klemen
Site Admin
Posts: 10135
Joined: Fri Feb 11, 2005 4:04 pm

Re: How to make attachment to be required?

Post by Klemen »

Add the end you could try something like

Code: Select all

if ( count($attachments) == 0 )
{
// error buffer here
}
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
memz
Posts: 3
Joined: Wed Mar 26, 2014 5:18 am

Re: How to make attachment to be required?

Post by memz »

Great..it works now..Thanks for the support. :)
Profi4You
Posts: 1
Joined: Wed Jan 31, 2024 12:30 am

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

Post 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!
Klemen
Site Admin
Posts: 10135
Joined: Fri Feb 11, 2005 4:04 pm

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

Post by Klemen »

Sure, feel free to share.
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
shddcit
Posts: 57
Joined: Wed Mar 30, 2022 3:54 pm

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

Post 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.
Post Reply