Browse Source

Use the new button layout on all dropzones

merge-requests/15/head
Mike Koch 6 years ago
parent
commit
41bbeaf97f
  1. 27
      admin/admin_ticket.php
  2. 33
      admin/manage_knowledgebase.php
  3. 17
      inc/view_attachment_functions.inc.php
  4. 15
      index.php
  5. 15
      ticket.php

27
admin/admin_ticket.php

@ -1298,18 +1298,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
</div>
</div>
<div class="col-md-6">
<div class="dropzone" id="notesFiledrop">
<div class="fallback">
<input type="hidden" name="use-legacy-attachments" value="1">
<?php
for ($i = 1; $i <= $hesk_settings['attachments']['max_number']; $i++) {
echo '<input type="file" name="attachment[' . $i . ']" size="50" /><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>
<?php build_dropzone_markup('notesFiledrop'); ?>
</div>
</div>
<?php display_dropzone_field($hesk_settings['hesk_url'] . '/internal-api/ticket/upload-attachment.php', 'notesFiledrop'); ?>
@ -1869,19 +1858,7 @@ function hesk_printReplyForm()
<label for="attachments" class="col-sm-3 control-label"><?php echo $hesklang['attachments']; ?>:</label>
<div 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>
<?php build_dropzone_markup(); ?>
</div>
</div>
<?php

33
admin/manage_knowledgebase.php

@ -442,17 +442,7 @@ if (!isset($_SESSION['hide']['new_article']))
<?php if ($hesk_settings['attachments']['use']): ?>
<div class="form-group">
<label for="attachments" class="control-label"><?php echo $hesklang['attachments']; ?> (<a href="Javascript:void(0)" onclick="Javascript:hesk_window('../file_limits.php',250,500);return false;"><?php echo $hesklang['ful']; ?></a>)</label>
<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++)
{
echo '<input type="file" name="attachment['.$i.']" size="50" /><br />';
}
?>
</div>
</div>
<?php build_dropzone_markup(); ?>
</div>
<?php
display_dropzone_field($hesk_settings['hesk_url'] . '/internal-api/admin/knowledgebase/upload-attachment.php');
@ -1505,24 +1495,9 @@ function edit_article()
}
?>
<div class="dropzone" id="filedrop">
<div class="fallback">
<input type="hidden" name="use-legacy-attachments" value="1">
<?php
// New attachments
if ($hesk_settings['attachments']['use'])
{
for ($i=1;$i<=$hesk_settings['attachments']['max_number'];$i++)
{
echo '<input type="file" name="attachment['.$i.']" size="50" /><br />';
}
}
?>
</div>
</div>
<?php display_dropzone_field($hesk_settings['hesk_url'] . '/internal-api/admin/knowledgebase/upload-attachment.php'); ?>
<?php
build_dropzone_markup();
display_dropzone_field($hesk_settings['hesk_url'] . '/internal-api/admin/knowledgebase/upload-attachment.php');
?>
</div>
<?php endif; //End attachments ?>

17
inc/view_attachment_functions.inc.php

@ -208,6 +208,23 @@ function output_attachment_id_holder_container($id) {
echo '<div id="attachment-holder-' . $id . '" class="hide"></div>';
}
function build_dropzone_markup($id = 'filedrop') {
global $hesklang, $hesk_settings;
echo '<div class="dropzone" id="' . $id . '">
<div class="fallback">
<input type="hidden" name="use-legacy-attachments" value="1">';
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 />';
}
echo '</div>
</div>
<button class="btn btn-default btn-xs fileinput-button filedrop-button">' . $hesklang['add_files'] . '</button><br>
<a href="file_limits.php" target="_blank"
onclick="Javascript:hesk_window(\'file_limits.php\',250,500);return false;">'. $hesklang['ful'] . '</a>';
}
function display_dropzone_field($url, $id = 'filedrop') {
global $hesk_settings, $hesklang;

15
index.php

@ -979,20 +979,7 @@ function print_add_ticket()
:</label>
<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>
<button class="btn btn-default btn-xs fileinput-button filedrop-button"><?php echo $hesklang['add_files']; ?></button><br>
<a href="file_limits.php" target="_blank"
onclick="Javascript:hesk_window('file_limits.php',250,500);return false;"><?php echo $hesklang['ful']; ?></a>
<?php build_dropzone_markup(); ?>
</div>
</div>
<?php

15
ticket.php

@ -654,20 +654,7 @@ function hesk_printCustomerReplyForm($reopen = 0)
:</label>
<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>
<?php build_dropzone_markup(); ?>
</div>
</div>
<?php

Loading…
Cancel
Save