$this->_defaultMemTypeId = $membership->membership_type_id;
if ($membership->contact_id != $this->_contactID) {
$validMembership = FALSE;
- $employers = CRM_Contact_BAO_Relationship::getPermissionedEmployer($this->_userID);
+ $employers = CRM_Contact_BAO_Relationship::getPermissionedContacts(
+ $this->_userID,
+ CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_RelationshipType', 'Employee of', 'id', 'name_a_b')
+ );
if (!empty($employers) && array_key_exists($membership->contact_id, $employers)) {
$this->_membershipContactID = $membership->contact_id;
$this->assign('membershipContactID', $this->_membershipContactID);
}
if ($contactID) {
- $employer = CRM_Contact_BAO_Relationship::getPermissionedEmployer($contactID);
+ $employers = CRM_Contact_BAO_Relationship::getPermissionedContacts(
+ $contactID,
+ CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_RelationshipType', 'Employee of', 'id', 'name_a_b')
+ );
if (count($employer)) {
// Related org url - pass checksum if needed