From 962c0edab2cc58187efa123d8c138c5fab6dbcaf Mon Sep 17 00:00:00 2001 From: yashodha Date: Mon, 29 Jul 2013 14:06:31 +0530 Subject: [PATCH] CRM-13092 --- CRM/Case/BAO/Query.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CRM/Case/BAO/Query.php b/CRM/Case/BAO/Query.php index 8e97b6c993..220fa6538e 100644 --- a/CRM/Case/BAO/Query.php +++ b/CRM/Case/BAO/Query.php @@ -521,7 +521,9 @@ class CRM_Case_BAO_Query { break; case 'civicrm_case_reporter': - $from .= " $side JOIN civicrm_activity_contact as case_activity_contact ON (case_activity.id = case_activity_contact.activity_id AND case_activity_contact.record_type_id = 2 ) "; + $activityContacts = CRM_Core_OptionGroup::values('activity_contacts', FALSE, FALSE, FALSE, NULL, 'name'); + $sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts); + $from .= " $side JOIN civicrm_activity_contact as case_activity_contact ON (case_activity.id = case_activity_contact.activity_id AND case_activity_contact.record_type_id = {$sourceID} ) "; $from .= " $side JOIN civicrm_contact as civicrm_case_reporter ON case_activity_contact.contact_id = civicrm_case_reporter.id "; break; -- 2.25.1