Skip to content

Commit

Permalink
Merge pull request #10438 from colemanw/CRM-20475
Browse files Browse the repository at this point in the history
CRM-20475 - Add missing phone info to case api
  • Loading branch information
colemanw authored May 30, 2017
2 parents a0fba50 + a0c7081 commit 62c54b6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion CRM/Case/BAO/Case.php
Original file line number Diff line number Diff line change
Expand Up @@ -1214,7 +1214,7 @@ public static function getRelatedContacts($caseID, $includeDetails = TRUE) {
}
$values = array();
$query = '
SELECT cc.display_name as name, cc.sort_name as sort_name, cc.id, cr.relationship_type_id, crt.label_b_a as role, crt.name_b_a, ce.email
SELECT cc.display_name as name, cc.sort_name as sort_name, cc.id, cr.relationship_type_id, crt.label_b_a as role, crt.name_b_a, ce.email, cp.phone
FROM civicrm_relationship cr
LEFT JOIN civicrm_relationship_type crt
ON crt.id = cr.relationship_type_id
Expand All @@ -1223,6 +1223,9 @@ public static function getRelatedContacts($caseID, $includeDetails = TRUE) {
LEFT JOIN civicrm_email ce
ON ce.contact_id = cc.id
AND ce.is_primary= 1
LEFT JOIN civicrm_phone cp
ON cp.contact_id = cc.id
AND cp.is_primary= 1
WHERE cr.case_id = %1 AND cr.is_active AND cc.is_deleted <> 1';

$params = array(1 => array($caseID, 'Integer'));
Expand All @@ -1240,6 +1243,7 @@ public static function getRelatedContacts($caseID, $includeDetails = TRUE) {
'relationship_type_id' => $dao->relationship_type_id,
'role' => $dao->role,
'email' => $dao->email,
'phone' => $dao->phone,
);
// Add more info about the role (creator, manager)
$role = CRM_Utils_Array::value($dao->name_b_a, $caseRoles);
Expand Down

0 comments on commit 62c54b6

Please sign in to comment.