return $currentEmployer;
}
- /**
- * Return list of permissioned employer for a given contact.
- *
- * @param int $contactID
- * contact id whose employers.
- * are to be found.
- * @param string $name
- * employers sort name.
- *
- * @return array
- * array of employers.
- */
- public static function getPermissionedEmployer($contactID, $name = NULL) {
- //get the relationship id
- $relTypeId = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_RelationshipType',
- 'Employee of', 'id', 'name_a_b'
- );
-
- return self::getPermissionedContacts($contactID, $relTypeId, $name);
- }
-
-
/**
* Function to return list of permissioned contacts for a given contact and relationship type.
*
$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
}
// Verify user permission on related contact
- $employers = CRM_Contact_BAO_Relationship::getPermissionedContacts($user);
+ $employers = CRM_Contact_BAO_Relationship::getPermissionedContacts(
+ $user,
+ CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_RelationshipType', 'Employee of', 'id', 'name_a_b')
+ );
if (!isset($employers[$cid])) {
CRM_Utils_System::civiExit();
}