* Function to return list of permissioned contacts for a given contact and relationship type
*
* @param $contactID int contact id whose permissioned contacts are to be found.
- * @param $relTypeId relationship type id
+ * @param $relTypeId string one or more relationship type id's
* @param $name string
*
* @static
FROM civicrm_relationship cr, civicrm_contact cc
WHERE
cr.contact_id_a = %1 AND
-cr.relationship_type_id = %2 AND
+cr.relationship_type_id IN (%2) AND
cr.is_permission_a_b = 1 AND
IF(cr.end_date IS NULL, 1, (DATEDIFF( CURDATE( ), cr.end_date ) <= 0)) AND
cr.is_active = 1 AND
AND cc.sort_name LIKE '%$name%'";
}
- $args = array(1 => array($contactID, 'Integer'), 2 => array($relTypeId, 'Integer'));
+ $args = array(1 => array($contactID, 'Integer'), 2 => array($relTypeId, 'String'));
$dao = CRM_Core_DAO::executeQuery($query, $args);
while ($dao->fetch()) {
} else {
$contactTypes = array();
foreach ($contactProfiles as $key => $value) {
- if (strpos($value, $leftType) !== FALSE) {
+ $groupTypes = CRM_Core_BAO_UFGroup::profileGroups($key);
+ if (in_array($leftType, $groupTypes)) {
$contactTypes = array($key => $value);
}
}