Skip to content
Snippets Groups Projects
Commit 1939d296 authored by monishdeb's avatar monishdeb
Browse files

CRM-13216 fix

----------------------------------------
* CRM-13216: Advanced Search shows deleted contacts
  http://issues.civicrm.org/jira/browse/CRM-13216
parent 46e649ba
No related branches found
No related tags found
No related merge requests found
......@@ -4198,17 +4198,6 @@ civicrm_relationship.start_date > {$today}
}
$this->generatePermissionClause($onlyDeleted, $count);
if (empty($where)) {
$where = "WHERE $this->_permissionWhereClause";
}
else {
$where = "$where AND $this->_permissionWhereClause";
}
if ($additionalWhereClause) {
$where = $where . ' AND ' . $additionalWhereClause;
}
// building the query string
$groupBy = NULL;
if (!$count) {
......@@ -4310,7 +4299,20 @@ civicrm_relationship.start_date > {$today}
list($select, $from, $where, $having) = $this->query($count, $sortByChar, $groupContacts);
//additional from clause should be w/ proper joins.
if(!empty($this->_permissionWhereClause)){
if (empty($where)) {
$where = "WHERE $this->_permissionWhereClause";
}
else {
$where = "$where AND $this->_permissionWhereClause";
}
}
if ($additionalWhereClause) {
$where = $where . ' AND ' . $additionalWhereClause;
}
//additional from clause should be w/ proper joins.
if ($additionalFromClause) {
$from .= "\n" . $additionalFromClause;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment