Advanced Search does not filter relationships with deleted contacts Fix
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 2 Dec 2014 05:14:03 +0000 (10:44 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Tue, 2 Dec 2014 05:14:03 +0000 (10:44 +0530)
CRM/Contact/BAO/Query.php

index 21dfd712d8702ade8f87cddaf31c39ef75d407b5..5e141405552e171adf162f9d5a29f68053610792 100644 (file)
@@ -4160,6 +4160,12 @@ civicrm_relationship.start_date > {$today}
       $this->_qill[$grouping][] = ts('Relationship - Inactive or not Current');
     }
 
+    $onlyDeleted = 0;
+    if (in_array(array('deleted_contacts', '=', '1', '0', '0'), $this->_params)) {
+      $onlyDeleted = 1;
+    }
+    $where[$grouping][] = "(contact_b.is_deleted = {$onlyDeleted})";
+
     //check for permissioned, non-permissioned and all permissioned relations
     if ($relPermission[2] == 1) {
       $where[$grouping][] = "(