From: yashodha Date: Mon, 29 Jul 2013 08:36:31 +0000 (+0530) Subject: CRM-13092 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=962c0edab2cc58187efa123d8c138c5fab6dbcaf;p=civicrm-core.git CRM-13092 --- 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;