'legacy_redirect_path' => 'civicrm/contribute/transact',
'legacy_redirect_query' => "_qf_Main_display=true&qfKey={$form->_params['qfKey']}",
);
- throw new CiviCRM_Exception($message, 0, $errorParams);
+ throw new CRM_Core_Exception($message, 0, $errorParams);
}
// CRM-7851
}
/**
+ * @todo - this form method needs to have the interaction with the form layer removed from it
+ * as a BAO function. Note that the api now supports membership renewals & it is not clear this function does anything
+ * not done by the membership.create api (with a lot less unit tests)
+ *
* This method will renew / create the membership depending on
* whether the given contact has a membership or not. And will add
* the modified dates for membership and in the log table.
// check is it pending. - CRM-4555
$pending = FALSE;
+ //@todo this is a BAO function & should not inspect the form - the form should do this
+ // & pass required params to the BAO
if (CRM_Utils_Array::value('minimum_fee', $membershipTypeDetails) > 0.0) {
if (((isset($form->_contributeMode) && $form->_contributeMode == 'notify') ||
CRM_Utils_Array::value('is_pay_later', $form->_params) ||
$allTypes = CRM_Member_PseudoConstant::membershipType();
$contribStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name');
+ // get only memberships with active membership types
$query = "
SELECT civicrm_membership.id as membership_id,
civicrm_membership.is_override as is_override,
civicrm_membership.contribution_recur_id as recur_id
FROM civicrm_membership
INNER JOIN civicrm_contact ON ( civicrm_membership.contact_id = civicrm_contact.id )
+INNER JOIN civicrm_membership_type ON
+ (civicrm_membership.membership_type_id = civicrm_membership_type.id AND civicrm_membership_type.is_active = 1)
WHERE civicrm_membership.is_test = 0";
$params = array();
// echo ".";
$processCount++;
- /**
- $count++;
- echo $dao->contact_id . ', '. CRM_Utils_System::memory( ) . "<p>\n";
-
- CRM_Core_Error::debug( 'fBegin', count( $GLOBALS['_DB_DATAOBJECT']['RESULTS'] ) );
- if ( $count > 2 ) {
- foreach ( $GLOBALS['_DB_DATAOBJECT']['RESULTS'] as $r ) {
- CRM_Core_Error::debug( 'r', $r->query );
- }
- // CRM_Core_Error::debug( 'f', $GLOBALS['_DB_DATAOBJECT']['RESULTS'] );
- exit( );
- }
- **/
-
// Put common parameters into array for easy access
$memberParams = array(
'id' => $dao->membership_id,