diff --git a/admin/admin_ticket.php b/admin/admin_ticket.php index 6b4cf175..27b48c4c 100644 --- a/admin/admin_ticket.php +++ b/admin/admin_ticket.php @@ -1520,7 +1520,7 @@ function hesk_listAttachments($attachments='', $reply=0, $white=1) $att=explode(',',substr($attachments, 0, -1)); echo '
'; echo ''; - echo ''; + echo ''; echo ''; foreach ($att as $myatt) { @@ -1569,6 +1569,9 @@ function hesk_listAttachments($attachments='', $reply=0, $white=1) +
 '.$hesklang['file_name'].''.$hesklang['action'].'
 '.$hesklang['file_name'].''.$hesklang['download_count'].''.$hesklang['action'].'

'.$att_name.'

+ '.mfh_getNumberOfDownloadsForAttachment($att_id).' +
'; /* Can edit and delete tickets? */ diff --git a/inc/common.inc.php b/inc/common.inc.php index 5a6a7074..1c43e76f 100644 --- a/inc/common.inc.php +++ b/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']; } \ No newline at end of file diff --git a/language/en/text.php b/language/en/text.php index f193e14c..f3f07ba1 100644 --- a/language/en/text.php +++ b/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';