From 38492b4bcbda5cc174ddb77501fdd51dad63a624 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 27 Oct 2016 14:59:53 -0400 Subject: [PATCH] CRM-19551 - Display multiple case activity attachments --- CRM/Case/BAO/Case.php | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/CRM/Case/BAO/Case.php b/CRM/Case/BAO/Case.php index 00f09efc55..5fb8c31487 100644 --- a/CRM/Case/BAO/Case.php +++ b/CRM/Case/BAO/Case.php @@ -1192,19 +1192,9 @@ SELECT case_status.label AS case_status, status_id, civicrm_case_type.title AS c } // if there are file attachments we will return how many and, if only one, add a link to it if (!empty($dao->attachment_ids)) { - $attachmentIDs = explode(',', $dao->attachment_ids); + $attachmentIDs = array_unique(explode(',', $dao->attachment_ids)); $caseActivity['no_attachments'] = count($attachmentIDs); - if ($caseActivity['no_attachments'] == 1) { - // if there is only one it's easy to do a link - otherwise just flag it - $attachmentViewUrl = CRM_Utils_System::url( - "civicrm/file", - "reset=1&eid=" . $caseActivityId . "&id=" . $dao->attachment_ids, - FALSE, - NULL, - FALSE - ); - $url .= " "; - } + $url .= implode(' ', CRM_Core_BAO_File::paperIconAttachment('civicrm_activity', $caseActivityId)); } $caseActivity['links'] = $url; -- 2.25.1