From: Coleman Watts Date: Thu, 27 Oct 2016 18:59:53 +0000 (-0400) Subject: CRM-19551 - Display multiple case activity attachments X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=38492b4bcbda5cc174ddb77501fdd51dad63a624;p=civicrm-core.git CRM-19551 - Display multiple case activity attachments --- 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;