Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-19551: Display paperclip icon for one or more unique Activity att… #9306

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CRM/Case/BAO/Case.php
Original file line number Diff line number Diff line change
Expand Up @@ -1193,6 +1193,7 @@ public static function getCaseActivity($caseID, &$params, $contactID, $context =
// 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($attachmentIDs);
$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
Expand All @@ -1205,6 +1206,10 @@ public static function getCaseActivity($caseID, &$params, $contactID, $context =
);
$url .= " <a href='$attachmentViewUrl' ><i class='crm-i fa-paperclip'></i></a>";
}
elseif ($caseActivity['no_attachments'] > 1) {
// if there are multiple attachments, display an icon with a count only - no link
$url .= " <i class='crm-i fa-paperclip'></i><span>x" . $caseActivity['no_attachments'] . "</span>";
}
}

$caseActivity['links'] = $url;
Expand Down