From ceb21ebb3fc683c3f9dfb1d452bcf6d9c0cce28d Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Fri, 1 Jul 2016 10:31:56 +0530 Subject: [PATCH] CRM-19014 - Avoid the fix to affect Activity Dashlet. --- CRM/Activity/BAO/Activity.php | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 68495fdf99..62f50c8290 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -2545,18 +2545,24 @@ INNER JOIN civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n $activity['target_contact_name'] = ''; foreach ($values['target_contact_name'] as $tcID => $tcName) { $targetTypeImage = ""; + $targetLink = CRM_Utils_System::href($tcName, 'civicrm/contact/view', "reset=1&cid={$tcID}"); if ($showContactOverlay) { $targetTypeImage = CRM_Contact_BAO_Contact_Utils::getImage( CRM_Contact_BAO_Contact::getContactType($tcID), FALSE, $tcID); + $activity['target_contact_name'] .= "
$targetTypeImage $targetLink"; + } + else { + $activity['target_contact_name'] .= $targetLink; } - $targetLink = CRM_Utils_System::href($tcName, 'civicrm/contact/view', "reset=1&cid={$tcID}"); - $activity['target_contact_name'] .= "
$targetTypeImage $targetLink
"; } if ($extraCount = $values['target_contact_counter'] - 1) { - $activity['target_contact_name'] .= "
" . "(" . ts('%1 more', array(1 => $extraCount)) . ")
"; + $activity['target_contact_name'] .= ";
" . "(" . ts('%1 more', array(1 => $extraCount)) . ")"; + } + if ($showContactOverlay) { + $activity['target_contact_name'] .= "
"; } } elseif (!$values['target_contact_name']) { @@ -2573,19 +2579,25 @@ INNER JOIN civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n foreach ($values['assignee_contact_name'] as $acID => $acName) { if ($acID && $count < 5) { $assigneeTypeImage = ""; + $assigneeLink = CRM_Utils_System::href($acName, 'civicrm/contact/view', "reset=1&cid={$acID}"); if ($showContactOverlay) { $assigneeTypeImage = CRM_Contact_BAO_Contact_Utils::getImage( CRM_Contact_BAO_Contact::getContactType($acID), FALSE, $acID); + $activity['assignee_contact_name'] .= "
$assigneeTypeImage $assigneeLink"; } - $assigneeLink = CRM_Utils_System::href($acName, 'civicrm/contact/view', "reset=1&cid={$acID}"); - $activity['assignee_contact_name'] .= "
$assigneeTypeImage $assigneeLink"; + else { + $activity['assignee_contact_name'] .= $assigneeLink; + } + $count++; if ($count) { - $activity['assignee_contact_name'] .= ";"; + $activity['assignee_contact_name'] .= "; "; + } + if ($showContactOverlay) { + $activity['assignee_contact_name'] .= "
"; } - $activity['assignee_contact_name'] .= "
"; if ($count == 4) { $activity['assignee_contact_name'] .= "(" . ts('more') . ")"; -- 2.25.1