//we might be renewing membership,
//so make status override false.
$membershipParams['is_override'] = FALSE;
- //CRM-17723 - avoid updating related membership from the api as the
- //static $relatedContactIds array() in CRM_Member_BAO_Membership::createdRelatedMemberships()
- //already contains these ids from previous call leading to deletion of related memberships.
- $membershipParams['reset'] = TRUE;
+ //CRM-17723 - reset static $relatedContactIds array()
+ $var = TRUE;
+ CRM_Member_BAO_Membership::createRelatedMemberships($var, $var, TRUE);
civicrm_api3('Membership', 'create', $membershipParams);
-
- // unset/format unwanted keys
- $removeKeys = array('id', 'contact_id', 'reset');
- $membershipParams = array_diff_key($membershipParams, array_flip($removeKeys));
- if (!empty($membershipParams['status_id']) && is_string($membershipParams['status_id'])) {
- $membershipParams['status_id'] = array_search($membershipParams['status_id'], CRM_Member_PseudoConstant::membershipStatus());
- }
- //update related Memberships.
- CRM_Member_BAO_Membership::updateRelatedMemberships($membership->id, $membershipParams);
}
}
}
$transaction->commit();
- $reset = FALSE;
- if (!empty($params['reset'])) {
- $reset = TRUE;
- }
- self::createRelatedMemberships($params, $membership, $reset);
+ self::createRelatedMemberships($params, $membership);
// do not add to recent items for import, CRM-4399
if (empty($params['skipRecentView'])) {
}
$isCancelSupported = CRM_Member_BAO_Membership::isCancelSubscriptionSupported($row['membership_id']);
- if (!isset($result->owner_membership_id)) {
- $links = self::links('all',
- $this->_isPaymentProcessor,
- $this->_accessContribution,
- $this->_key,
- $this->_context,
- $isCancelSupported
- );
- }
- else {
- $links = self::links('view');
- }
+ $links = self::links('all',
+ $this->_isPaymentProcessor,
+ $this->_accessContribution,
+ $this->_key,
+ $this->_context,
+ $isCancelSupported
+ );
+
// check permissions
$finTypeId = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $result->membership_type_id, 'financial_type_id');
$finType = CRM_Contribute_PseudoConstant::financialType($finTypeId);
);
}
else {
+ $links = self::links('view');
$row['action'] = CRM_Core_Action::formLink($links, $mask,
array(
'id' => $result->membership_id,