CRM-19014 - Avoid the fix to affect Activity Dashlet.
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Fri, 1 Jul 2016 05:01:56 +0000 (10:31 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Fri, 1 Jul 2016 05:01:56 +0000 (10:31 +0530)
CRM/Activity/BAO/Activity.php

index 68495fdf998b1271629f4383133cb1faffab1589..62f50c8290c19e8d6490a564bd06ba8e22e94f74 100644 (file)
@@ -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'] .= "<div>$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'] .= "<div>$targetTypeImage  $targetLink</div>";
           }
 
           if ($extraCount = $values['target_contact_counter'] - 1) {
-            $activity['target_contact_name'] .= "<div>" . "(" . ts('%1 more', array(1 => $extraCount)) . ")</div>";
+            $activity['target_contact_name'] .= ";<br />" . "(" . ts('%1 more', array(1 => $extraCount)) . ")";
+          }
+          if ($showContactOverlay) {
+            $activity['target_contact_name'] .= "</div> ";
           }
         }
         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'] .= "<div>$assigneeTypeImage $assigneeLink";
               }
-              $assigneeLink = CRM_Utils_System::href($acName, 'civicrm/contact/view', "reset=1&cid={$acID}");
-              $activity['assignee_contact_name'] .= "<div>$assigneeTypeImage $assigneeLink";
+              else {
+                $activity['assignee_contact_name'] .= $assigneeLink;
+              }
+
               $count++;
               if ($count) {
-                $activity['assignee_contact_name'] .= ";";
+                $activity['assignee_contact_name'] .= ";&nbsp;";
+              }
+              if ($showContactOverlay) {
+                $activity['assignee_contact_name'] .= "</div> ";
               }
-              $activity['assignee_contact_name'] .= "</div> ";
 
               if ($count == 4) {
                 $activity['assignee_contact_name'] .= "(" . ts('more') . ")";