From e846bd8d35dad31bad0fe125fad961eced9824b1 Mon Sep 17 00:00:00 2001 From: nielosz Date: Thu, 30 Jun 2016 11:38:30 +0200 Subject: [PATCH] Dont show overlay on dashlets which limit space --- CRM/Activity/BAO/Activity.php | 37 +++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 2cb1893ebd..dd4f5f8db2 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -2468,6 +2468,7 @@ INNER JOIN civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n $params['sort'] = CRM_Utils_Array::value('sortBy', $params); $params['caseId'] = NULL; $context = CRM_Utils_Array::value('context', $params); + $showContactOverlay = !CRM_Utils_String::startsWith($context,"dashlet"); // Get contact activities. $activities = CRM_Activity_BAO_Activity::getActivities($params); @@ -2517,11 +2518,13 @@ INNER JOIN civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n $activity['source_contact_name'] = $values['source_contact_name']; } elseif ($values['source_contact_id']) { - $srcTypeImage = CRM_Contact_BAO_Contact_Utils::getImage( - CRM_Contact_BAO_Contact::getContactType($values['source_contact_id']), - FALSE, - $values['source_contact_id'] - ); + $srcTypeImage = ""; + if ($showContactOverlay) { + $srcTypeImage = CRM_Contact_BAO_Contact_Utils::getImage( + CRM_Contact_BAO_Contact::getContactType($values['source_contact_id']), + FALSE, + $values['source_contact_id']); + } $activity['source_contact_name'] = $srcTypeImage . CRM_Utils_System::href($values['source_contact_name'], 'civicrm/contact/view', "reset=1&cid={$values['source_contact_id']}"); } @@ -2541,11 +2544,13 @@ INNER JOIN civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n elseif (isset($values['target_contact_counter']) && $values['target_contact_counter']) { $activity['target_contact_name'] = ''; foreach ($values['target_contact_name'] as $tcID => $tcName) { - $targetTypeImage = CRM_Contact_BAO_Contact_Utils::getImage( - CRM_Contact_BAO_Contact::getContactType($tcID), - FALSE, - $tcID - ); + $targetTypeImage = ""; + if ($showContactOverlay) { + $targetTypeImage = CRM_Contact_BAO_Contact_Utils::getImage( + CRM_Contact_BAO_Contact::getContactType($tcID), + FALSE, + $tcID); + } $targetLink = CRM_Utils_System::href($tcName, 'civicrm/contact/view', "reset=1&cid={$tcID}"); $activity['target_contact_name'] .= "
$targetTypeImage $targetLink
"; } @@ -2567,11 +2572,13 @@ INNER JOIN civicrm_option_group grp ON ( grp.id = val.option_group_id AND grp.n $activity['assignee_contact_name'] = ''; foreach ($values['assignee_contact_name'] as $acID => $acName) { if ($acID && $count < 5) { - $assigneeTypeImage = CRM_Contact_BAO_Contact_Utils::getImage( - CRM_Contact_BAO_Contact::getContactType($acID), - FALSE, - $acID - ); + $assigneeTypeImage = ""; + if ($showContactOverlay) { + $assigneeTypeImage = CRM_Contact_BAO_Contact_Utils::getImage( + CRM_Contact_BAO_Contact::getContactType($acID), + FALSE, + $acID); + } $assigneeLink = CRM_Utils_System::href($acName, 'civicrm/contact/view', "reset=1&cid={$acID}"); $activity['assignee_contact_name'] .= "
$assigneeTypeImage $assigneeLink"; $count++; -- 2.25.1