From 71fc6befa1baccaf17a4f6b74f02d800178f350c Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sun, 27 Dec 2015 20:53:41 -0500 Subject: [PATCH] Reply ticket now uses new attachment holder --- reply_ticket.php | 21 +++++++++++++++++---- ticket.php | 26 ++++++++++++++++++-------- 2 files changed, 35 insertions(+), 12 deletions(-) diff --git a/reply_ticket.php b/reply_ticket.php index db6ffcb0..0617ed3c 100644 --- a/reply_ticket.php +++ b/reply_ticket.php @@ -88,10 +88,23 @@ if (strlen($message) && !$modsForHesk_settings['rich_text_for_tickets_for_custom if ($hesk_settings['attachments']['use']) { require(HESK_PATH . 'inc/attachments.inc.php'); $attachments = array(); - for ($i = 1; $i <= $hesk_settings['attachments']['max_number']; $i++) { - $att = hesk_uploadFile($i); - if ($att !== false && !empty($att)) { - $attachments[$i] = $att; + + $use_legacy_attachments = hesk_POST('use-legacy-attachments', 0); + if ($use_legacy_attachments) { + for ($i = 1; $i <= $hesk_settings['attachments']['max_number']; $i++) { + $att = hesk_uploadFile($i); + if ($att !== false && !empty($att)) { + $attachments[$i] = $att; + } + } + } else { + // The user used the new drag-and-drop system. + $temp_attachment_ids = hesk_POST_array('attachment-ids'); + foreach ($temp_attachment_ids as $temp_attachment_id) { + // Simply get the temp info and move it to the attachments table + $temp_attachment = mfh_getTemporaryAttachment($temp_attachment_id); + $attachments[] = $temp_attachment; + mfh_deleteTemporaryAttachment($temp_attachment_id); } } } diff --git a/ticket.php b/ticket.php index 583c42dd..2b0fb450 100644 --- a/ticket.php +++ b/ticket.php @@ -630,18 +630,28 @@ function hesk_printCustomerReplyForm($reopen = 0) if ($hesk_settings['attachments']['use']) { ?>
- + + +
+
+
+ +
'; + } + ?> +
+
-
-
'; - } - echo '' . $hesklang['ful'] . ''; - ?> +