Reply ticket now uses new attachment holder
This commit is contained in:
parent
07b82c4d93
commit
71fc6befa1
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
26
ticket.php
26
ticket.php
@ -630,18 +630,28 @@ function hesk_printCustomerReplyForm($reopen = 0)
|
||||
if ($hesk_settings['attachments']['use']) {
|
||||
?>
|
||||
<div class="form-group">
|
||||
<label for="attachments" class="col-sm-3 control-label"><?php echo $hesklang['attachments']; ?>:</label>
|
||||
<label for="attachments" class="col-sm-3 control-label"><?php echo $hesklang['attachments']; ?>
|
||||
:</label>
|
||||
|
||||
<div class="col-sm-9 text-left">
|
||||
<?php
|
||||
for ($i = 1; $i <= $hesk_settings['attachments']['max_number']; $i++) {
|
||||
echo '<input type="file" name="attachment[' . $i . ']" size="50" /><br />';
|
||||
}
|
||||
echo '<a href="file_limits.php" target="_blank" onclick="Javascript:hesk_window(\'file_limits.php\',250,500);return false;">' . $hesklang['ful'] . '</a>';
|
||||
?>
|
||||
<div align="left" class="col-sm-9">
|
||||
<div class="dropzone" id="filedrop">
|
||||
<div class="fallback">
|
||||
<input type="hidden" name="use-legacy-attachments" value="1">
|
||||
<?php
|
||||
for ($i = 1; $i <= $hesk_settings['attachments']['max_number']; $i++) {
|
||||
$cls = ($i == 1 && in_array('attachments', $_SESSION['iserror'])) ? ' class="isError" ' : '';
|
||||
echo '<input type="file" name="attachment[' . $i . ']" size="50" ' . $cls . ' /><br />';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a href="file_limits.php" target="_blank"
|
||||
onclick="Javascript:hesk_window('file_limits.php',250,500);return false;"><?php echo $hesklang['ful']; ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
display_dropzone_field(HESK_PATH . 'internal-api/ticket/upload-attachment.php');
|
||||
}
|
||||
?>
|
||||
<input type="hidden" name="token" value="<?php hesk_token_echo(); ?>"/>
|
||||
|
Loading…
x
Reference in New Issue
Block a user