Dont show overlay on dashlets which limit space
authornielosz <nielosz@users.noreply.github.com>
Thu, 30 Jun 2016 09:38:30 +0000 (11:38 +0200)
committerGitHub <noreply@github.com>
Thu, 30 Jun 2016 09:38:30 +0000 (11:38 +0200)
CRM/Activity/BAO/Activity.php

index 2cb1893ebd5987db0f2939ddbcc6ab975c2acd96..dd4f5f8db2c8d8ae1dc54c88c2d255408bf63ab0 100644 (file)
@@ -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'] .= "<div>$targetTypeImage  $targetLink</div>";
           }
@@ -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'] .= "<div>$assigneeTypeImage $assigneeLink";
               $count++;