remove getPermissionedEmployer fn
[civicrm-core.git] / CRM / Contribute / Form / ContributionBase.php
index 91de4742fb0728ca07e7fed4b6c11ade11484bb5..ca91a152545f379b4344974bc9946961478bbd53 100644 (file)
@@ -215,7 +215,10 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
           $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);
@@ -815,7 +818,10 @@ class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
         }
 
         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