From 74a99693c42314b1b8d85e566bffd3c5f490cd23 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 Conflicts: CRM/Case/BAO/Case.php --- 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 e83a961595..f7fc28c687 100644 --- a/CRM/Case/BAO/Case.php +++ b/CRM/Case/BAO/Case.php @@ -1313,19 +1313,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)); $values[$dao->id]['no_attachments'] = count($attachmentIDs); - if ($values[$dao->id]['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=" . $dao->id . "&id=" . $dao->attachment_ids, - FALSE, - NULL, - FALSE - ); - $url .= " "; - } + $url .= implode(' ', CRM_Core_BAO_File::paperIconAttachment('civicrm_activity', $dao->id)); } $values[$dao->id]['links'] = $url; -- 2.25.1