CRM-11342 - Fix for correct filtering of permissioned employees.
authorDave Greenberg <dave@civicrm.org>
Sat, 4 Oct 2014 00:54:46 +0000 (17:54 -0700)
committerDave Greenberg <dave@civicrm.org>
Sat, 4 Oct 2014 00:54:46 +0000 (17:54 -0700)
----------------------------------------
* CRM-11342:
  https://issues.civicrm.org/jira/browse/CRM-11342

CRM/Core/BAO/ActionSchedule.php

index b2f93dfede01d77c4d285dc5824a04e1fbadfd99..03b5c15991cd81881b5c935b418b0b397e409c62 100755 (executable)
@@ -1269,7 +1269,7 @@ GROUP BY c.id
 {$fromClause}
 {$joinClause}
 INNER JOIN {$reminderJoinClause}
-{$whereClause} {$limitWhereClause} AND {$repeatEventClause}
+{$whereClause} {$limitWhereClause} AND {$repeatEventClause} {$notINClause}
 {$groupByClause}
 {$havingClause}";
 
@@ -1343,10 +1343,10 @@ WHERE     m.owner_membership_id IS NOT NULL AND
     $excludeIds = array();
     $dao = CRM_Core_DAO::executeQuery($query, array());
     while ($dao->fetch()) {
-      if ($dao->slave_contact == $dao->contact_id_a && $dao->is_permission_b_a == 0) {
+      if ($dao->slave_contact == $dao->contact_id_a && $dao->is_permission_a_b == 0) {
         $excludeIds[] = $dao->slave_contact;
       }
-      elseif ($dao->slave_contact == $dao->contact_id_b && $dao->is_permission_a_b == 0) {
+      elseif ($dao->slave_contact == $dao->contact_id_b && $dao->is_permission_b_a == 0) {
         $excludeIds[] = $dao->slave_contact;
       }
     }