) {
CRM_Member_BAO_Membership::buildMembershipBlock($this,
$this->_id,
+ $this->_membershipContactID,
FALSE,
$params['selectMembership'],
- FALSE, NULL,
- $this->_membershipContactID
+ FALSE
);
}
else {
$this->_separateMembershipPayment = CRM_Member_BAO_Membership::buildMembershipBlock($this,
$this->_id,
+ $this->_membershipContactID,
TRUE, NULL, FALSE,
- $isTest, $this->_membershipContactID
+ $isTest
);
}
$this->set('separateMembershipPayment', $this->_separateMembershipPayment);
CRM_Member_BAO_Membership::buildMembershipBlock($this,
$this->_id,
+ $this->_membershipContactID,
FALSE,
$membershipTypeID,
- TRUE, NULL,
- $this->_membershipContactID
+ TRUE,
+ NULL
);
}
*/
public $_pcpInfo;
+ /**
+ * The contact id of the person for whom membership is being added or renewed based on the cid in the url,
+ * checksum, or session
+ * @var unknown_type
+ */
+ protected $_contactID;
+
protected $_userID;
/**
else {
$session->set('pastContributionID', $this->_id);
}
-
+ // this was used prior to the cleverer this_>getContactID - unsure now
$this->_userID = $session->get('userID');
+
+ $this->_contactID = $this->_membershipContactID = $this->getContactID();
$this->_mid = NULL;
- if ($this->_userID) {
+ if ($this->_contactID) {
$this->_mid = CRM_Utils_Request::retrieve('mid', 'Positive', $this);
if ($this->_mid) {
$membership = new CRM_Member_DAO_Membership();
if ($membership->find(TRUE)) {
$this->_defaultMemTypeId = $membership->membership_type_id;
- if ($membership->contact_id != $this->_userID) {
+ if ($membership->contact_id != $this->_contactID) {
$employers = CRM_Contact_BAO_Relationship::getPermissionedEmployer($this->_userID);
if (array_key_exists($membership->contact_id, $employers)) {
$this->_membershipContactID = $membership->contact_id;
*/
static function buildMembershipBlock(&$form,
$pageID,
+ $cid,
$formItems = FALSE,
$selectedMembershipTypeID = NULL,
$thankPage = FALSE,
- $isTest = NULL,
- $memberContactId = NULL
+ $isTest = NULL
) {
$separateMembershipPayment = FALSE;
if ($form->_membershipBlock) {
$form->_currentMemberships = array();
- if (!$memberContactId) {
- $session = CRM_Core_Session::singleton();
- $cid = $session->get('userID');
- }
- else {
- $cid = $memberContactId;
- }
$membershipBlock = $form->_membershipBlock;
$membershipTypeIds = $membershipTypes = $radio = array();