From c79f662a15c389b190169d1a1193fb94131b4cec Mon Sep 17 00:00:00 2001 From: yashodha Date: Wed, 29 May 2013 15:15:35 +0530 Subject: [PATCH] more clean up (CRM-12697) --- CRM/Activity/Form/Task/SearchTaskHookSample.php | 6 +++++- CRM/Activity/Selector/Search.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CRM/Activity/Form/Task/SearchTaskHookSample.php b/CRM/Activity/Form/Task/SearchTaskHookSample.php index 25962a414b..69131428f9 100644 --- a/CRM/Activity/Form/Task/SearchTaskHookSample.php +++ b/CRM/Activity/Form/Task/SearchTaskHookSample.php @@ -49,13 +49,17 @@ class CRM_Activity_Form_Task_SearchTaskHookSample extends CRM_Activity_Form_Task $rows = array(); // display name and activity details of all selected contacts $activityIDs = implode(',', $this->_activityHolderIds); + + $activityContacts = CRM_Core_PseudoConstant::activityContacts('name'); + $sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); $query = " SELECT at.subject as subject, ov.label as activity_type, at.activity_date_time as activity_date, ct.display_name as display_name FROM civicrm_activity at -INNER JOIN civicrm_contact ct ON ( at.source_contact_id = ct.id ) +LEFT JOIN civicrm_activity_contact ac ON ( ac.activity_id = at.id AND ac.record_type_id = {$sourceID} ) +INNER JOIN civicrm_contact ct ON ( ac.contact_id = ct.id ) LEFT JOIN civicrm_option_group og ON ( og.name = 'activity_type' ) LEFT JOIN civicrm_option_value ov ON (at.activity_type_id = ov.value AND og.id = ov.option_group_id ) WHERE at.id IN ( $activityIDs )"; diff --git a/CRM/Activity/Selector/Search.php b/CRM/Activity/Selector/Search.php index eb0d951991..81a5d9bd79 100644 --- a/CRM/Activity/Selector/Search.php +++ b/CRM/Activity/Selector/Search.php @@ -300,7 +300,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM ($bulkActivityTypeID == $activityTypeId) ) { $row['mailingId'] = CRM_Utils_System::url('civicrm/mailing/report', - "mid={$result->source_record_id}&reset=1&cid={$result->source_contact_id}&context=activitySelector" + "mid={$result->source_record_id}&reset=1&cid={$contactId}&context=activitySelector" ); $row['recipients'] = ts('(recipients)'); $row['target_contact_name'] = ''; -- 2.25.1