Browse Source

#275 Show download count next to attachment name

merge-requests/2/head
Mike Koch 7 years ago
parent
commit
246d2e6261
  1. 5
      admin/admin_ticket.php
  2. 9
      inc/common.inc.php
  3. 1
      language/en/text.php

5
admin/admin_ticket.php

@ -1520,7 +1520,7 @@ function hesk_listAttachments($attachments='', $reply=0, $white=1)
$att=explode(',',substr($attachments, 0, -1));
echo '<div class="table-responsive">';
echo '<table class="table table-striped attachment-table">';
echo '<thead><tr><th>&nbsp;</th><th>'.$hesklang['file_name'].'</th><th>'.$hesklang['action'].'</th></tr></thead>';
echo '<thead><tr><th>&nbsp;</th><th>'.$hesklang['file_name'].'</th><th>'.$hesklang['download_count'].'</th><th>'.$hesklang['action'].'</th></tr></thead>';
echo '<tbody>';
foreach ($att as $myatt)
{
@ -1569,6 +1569,9 @@ function hesk_listAttachments($attachments='', $reply=0, $white=1)
<td>
<p>'.$att_name.'</p>
</td>
<td>
'.mfh_getNumberOfDownloadsForAttachment($att_id).'
</td>
<td>
<div class="btn-group">';
/* Can edit and delete tickets? */

9
inc/common.inc.php

@ -1972,4 +1972,13 @@ function mfh_getDisplayTextForStatusId($statusId) {
// Fallback to the language key
return $hesklang[$statusRec['Key']];
}
}
function mfh_getNumberOfDownloadsForAttachment($att_id, $table='attachments')
{
global $hesk_settings;
$res = hesk_dbQuery('SELECT `download_count` FROM `'.hesk_dbEscape($hesk_settings['db_pfix'].$table)."` WHERE `att_id` = ".intval($att_id));
$rec = hesk_dbFetchAssoc($res);
return $rec['download_count'];
}

1
language/en/text.php

@ -53,6 +53,7 @@ $hesklang['status_sort'] = 'Status Sorting';
$hesklang['status_sort_help'] = 'Determines if statuses shown on the manage statuses page and all dropdowns are sorted by the user-defined order (default), or sorted alphabetically.';
$hesklang['cannot_delete_status_tickets'] = 'This status cannot be deleted because there are tickets set to this status.';
$hesklang['default_statuses_updated'] = 'Default statuses have been updated!';
$hesklang['download_count'] = 'Download Count';
// ADDED OR MODIFIED IN Mods for HESK 2.3.0
$hesklang['sm_icon'] = 'Icon';

Loading…
Cancel
Save