CRM-13092
authoryashodha <yashodha.chaku@webaccess.co.in>
Mon, 29 Jul 2013 08:36:31 +0000 (14:06 +0530)
committeryashodha <yashodha.chaku@webaccess.co.in>
Mon, 29 Jul 2013 08:36:31 +0000 (14:06 +0530)
CRM/Case/BAO/Query.php

index 8e97b6c993e5dc06eec640b7ac2c155cc298b090..220fa6538e5ac1c94ca198fdc33d5f049ac692d4 100644 (file)
@@ -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;