Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRM-21384 - Don't show deleted contacts in case relations #11224

Merged
merged 2 commits into from
Nov 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CRM/Case/BAO/Case.php
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ public static function getContactNames($caseId) {
LEFT JOIN civicrm_case_contact ON civicrm_case_contact.contact_id = contact_a.id
LEFT JOIN civicrm_email ce ON ( ce.contact_id = contact_a.id AND ce.is_primary = 1)
LEFT JOIN civicrm_phone cp ON ( cp.contact_id = contact_a.id AND cp.is_primary = 1)
WHERE civicrm_case_contact.case_id = %1
WHERE contact_a.is_deleted = 0 AND civicrm_case_contact.case_id = %1
ORDER BY civicrm_case_contact.id";

$dao = CRM_Core_DAO::executeQuery($query,
Expand Down Expand Up @@ -817,7 +817,7 @@ public static function getCaseRoles($contactID, $caseID, $relationshipID = NULL)
LEFT JOIN civicrm_phone ON (civicrm_phone.contact_id = con.id AND civicrm_phone.is_primary = 1)
LEFT JOIN civicrm_email ON (civicrm_email.contact_id = con.id AND civicrm_email.is_primary = 1)
WHERE (rel.contact_id_a = %1 OR rel.contact_id_b = %1) AND rel.case_id = %2
AND rel.is_active = 1 AND (rel.end_date IS NULL OR rel.end_date > NOW())';
AND rel.is_active = 1 AND con.is_deleted = 0 AND (rel.end_date IS NULL OR rel.end_date > NOW())';

$params = array(
1 => array($contactID, 'Positive'),
Expand Down