Attachments and 2.5

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
TimPSNC
Posts: 41
Joined: Tue Jan 08, 2013 12:33 pm

Attachments and 2.5

Post by TimPSNC »

Script URL:
Version of script: 2.5.0
Hosting company:
URL of phpinfo.php:
URL of session_test.php:
What terms did you try when SEARCHING for a solution:

Write your message below:

I've started using 2.5.0 and all looks good, however, when an attachment is removed the notification of this isn't very pretty- it gets buried in the message of the email. Is it possible to to have this under the attachments section/heading, so it is more easily seen?

Also, I'm pleased to see that there is a link to download the attachment. Is there a way of inserting this link directly into the message sent (ie a staff member can write click the following link to download, and then have press a button to have it inserted there)? Currently it is at the bottom of the email which gets lost, as it is now under my signature and disclaimer.
Klemen
Site Admin
Posts: 10147
Joined: Fri Feb 11, 2005 4:04 pm

Re: Attachments and 2.5

Post by Klemen »

You can try adding it just below message by changing this code in inc/email_functions.inc.php

Code: Select all

		// Replace message
		$msg = str_replace('%%MESSAGE%%',$ticket['message'],$msg);

		// Add direct links to any attachments at the bottom of the email message
		if ($hesk_settings['attachments']['use'] && isset($ticket['attachments']) && strlen($ticket['attachments']) )
		{
			$msg .= "\n\n\n" . $hesklang['fatt'];

			$att = explode(',', substr($ticket['attachments'], 0, -1));
			foreach ($att as $myatt)
			{
				list($att_id, $att_name) = explode('#', $myatt);
				$msg .= "\n\n" . $att_name . "\n" . $hesk_settings['hesk_url'] . '/download_attachment.php?att_id='.$att_id.'&track='.$ticket['trackid'].$hesk_settings['e_param'];
			}
		}
to

Code: Select all

		// Add direct links to any attachments at the bottom of the email message
        $tmp = '';
		if ($hesk_settings['attachments']['use'] && isset($ticket['attachments']) && strlen($ticket['attachments']) )
		{
			$tmp .= "\n\n\n" . $hesklang['fatt'];

			$att = explode(',', substr($ticket['attachments'], 0, -1));
			foreach ($att as $myatt)
			{
				list($att_id, $att_name) = explode('#', $myatt);
				$tmp .= "\n\n" . $att_name . "\n" . $hesk_settings['hesk_url'] . '/download_attachment.php?att_id='.$att_id.'&track='.$ticket['trackid'].$hesk_settings['e_param'];
			}
		}

		// Replace message
		$msg = str_replace('%%MESSAGE%%',$ticket['message'] . $tmp,$msg);

Direct links inserted within text are not supported I'm afraid.
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
Post Reply