Do not show "My Cases" where relationship is inactive in dashboard.
authorFrancis Whittle <francis@agileware.com.au>
Tue, 30 Oct 2018 01:19:16 +0000 (12:19 +1100)
committerAgileware Support <support@agileware.com.au>
Tue, 20 Nov 2018 03:53:56 +0000 (14:53 +1100)
CRM/Case/BAO/Case.php

index 0e4260c3ef8e74fd60e88b9f6949266dee921efb..f6f682f2d836d309a6b3cffc3679bdfa423f9d89 100644 (file)
@@ -619,7 +619,7 @@ LEFT JOIN civicrm_option_group aog ON aog.name='activity_type'
     $whereClauses = array('civicrm_case.is_deleted = 0 AND civicrm_contact.is_deleted <> 1');
 
     if (!$allCases) {
-      $whereClauses[] .= " case_relationship.contact_id_b = {$userID} ";
+      $whereClauses[] .= " case_relationship.contact_id_b = {$userID} AND case_relationship.is_active ";
     }
     if (empty($params['status_id']) && ($type == 'upcoming' || $type == 'any')) {
       $whereClauses[] = " civicrm_case.status_id != " . CRM_Core_PseudoConstant::getKey('CRM_Case_BAO_Case', 'case_status_id', 'Closed');