diff --git a/admin/admin_ticket.php b/admin/admin_ticket.php index 27b48c4c..02073ebd 100644 --- a/admin/admin_ticket.php +++ b/admin/admin_ticket.php @@ -42,6 +42,7 @@ require(HESK_PATH . 'modsForHesk_settings.inc.php'); require(HESK_PATH . 'inc/common.inc.php'); require(HESK_PATH . 'inc/admin_functions.inc.php'); require(HESK_PATH . 'inc/status_functions.inc.php'); +require(HESK_PATH . 'inc/view_attachment_functions.inc.php'); hesk_load_database_functions(); hesk_session_start(); @@ -1430,7 +1431,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); } } /* Attachments */ - hesk_listAttachments($ticket['attachments']); + mfh_listAttachments($ticket['attachments'], 0, true); // Show suggested KB articles if ($hesk_settings['kb_enable'] && $hesk_settings['kb_recommendanswers'] && strlen($ticket['articles']) ) @@ -1504,157 +1505,6 @@ require_once(HESK_PATH . 'inc/footer.inc.php'); /*** START FUNCTIONS ***/ - -function hesk_listAttachments($attachments='', $reply=0, $white=1) -{ - global $hesk_settings, $hesklang, $trackingID, $can_edit, $can_delete; - - /* Attachments disabled or not available */ - if ( ! $hesk_settings['attachments']['use'] || ! strlen($attachments) ) - { - return false; - } - - /* List attachments */ - echo '
'.$hesklang['attachments'].':
'.$hesklang['file_name'].' | '.$hesklang['download_count'].' | '.$hesklang['action'].' | |
---|---|---|---|
';
- //-- File is an image
- if ($fontAwesomeIcon == 'fa fa-file-image-o') {
-
- //-- Get the actual image location and display a thumbnail. It will be linked to a modal to view a larger size.
- $path = hesk_getSavedNameUrlForAttachment($att_id);
- if ($path == '') {
- echo '';
- } else {
- echo '
- |
-
- '.$att_name.' - |
- - '.mfh_getNumberOfDownloadsForAttachment($att_id).' - | -
- ';
- /* Can edit and delete tickets? */
- if ($can_edit && $can_delete)
- {
- echo ' ';
- }
- echo '
-
- ';
- echo '
- |
-
+ | ' . $hesklang['file_name'] . ' | '; + if ($is_staff) { + echo ''.$hesklang['download_count'].' | '; + } + echo ''.$hesklang['action'].' | +
---|---|---|---|
';
+ //-- File is an image
+ if ($fontAwesomeIcon == 'fa fa-file-image-o') {
+
+ //-- Get the actual image location and display a thumbnail. It will be linked to a modal to view a larger size.
+ $path = mfh_getSavedNameUrlForAttachment($att_id, $is_staff);
+ if ($path == '') {
+ echo '';
+ } else {
+ echo '
+ |
+
+ '.$att_name.' + | ';
+ if ($is_staff) {
+ echo ''.mfh_getNumberOfDownloadsForAttachment($att_id).' | '; + } + echo '
+ ';
+ /* Can edit and delete tickets? */
+ if ($is_staff && $can_edit && $can_delete)
+ {
+ echo ' ';
+ }
+ echo '
+
+ ';
+ echo '
+ |
+
'.$hesklang['attachments'].':
';
- $att=explode(',',substr($attachments, 0, -1));
- foreach ($att as $myatt)
- {
- list($att_id, $att_name) = explode('#', $myatt);
-
- echo '
-
- '.$att_name.'
- ';
- }
- echo '