*/
protected $_context;
+ /**
+ * An array to hold a list of datefields on the form
+ * so that they can be converted to ISO in a consistent manner
+ *
+ * @var array
+ */
+ protected $_dateFields = array(
+ 'receive_date' => array('default' => 'now'),
+ );
+
public function preProcess() {
//custom data related code
$this->_cdType = CRM_Utils_Array::value('type', $_GET);
}
// also check for billing information
// get the billing location type
- $locationTypes = CRM_Core_PseudoConstant::locationType();
+ $locationTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Address', 'location_type_id');
// CRM-8108 remove ts around Billing location type
//$this->_bltID = array_search( ts('Billing'), $locationTypes );
$this->_bltID = array_search('Billing', $locationTypes);
$this->add('text', 'total_amount', ts('Amount'));
$this->addRule('total_amount', ts('Please enter a valid amount.'), 'money');
- $this->addDate('receive_date', ts('Received'), FALSE, array('formatType' => 'activityDate'));
+ $this->addDate('receive_date', ts('Received'), FALSE, array('formatType' => 'activityDateTime'));
$this->add('text', 'num_terms', ts('Extend Membership by'), array('onchange' => "setPaymentBlock();"), TRUE);
$this->addRule('num_terms', ts('Please enter a whole number for how many periods to renew.'), 'integer');
// causes a conflict in standalone mode so skip in standalone for now
$this->addElement('checkbox', 'contribution_contact', ts('Record Payment from a Different Contact?'));
$this->add( 'select', 'honor_type_id', ts('Membership payment is : '),
- array( '' => ts( '-') ) + CRM_Core_PseudoConstant::honor() );
+ array( '' => ts( '-') ) + CRM_Core_PseudoConstant::get('CRM_Contribute_DAO_Contribution', 'honor_type_id') );
require_once 'CRM/Contact/Form/NewContact.php';
CRM_Contact_Form_NewContact::buildQuickForm($this,1, null, false,'contribution_');
}
}
$now = CRM_Utils_Date::getToday( null, 'YmdHis');
- if (CRM_Utils_Array::value('receive_date', $this->_params)) {
- $formValues['receive_date'] = CRM_Utils_Date::processDate($this->_params['receive_date']);
- }
- else {
- $formValues['receive_date'] = $now;
- }
+ $this->convertDateFieldsToMySQL($formValues);
$this->assign('receive_date', $formValues['receive_date']);
if (CRM_Utils_Array::value('send_receipt', $this->_params)) {
$lineItem = array();
$priceSetId = null;
CRM_Member_BAO_Membership::createLineItems($this, $formValues['membership_type_id'], $priceSetId);
- CRM_Price_BAO_Set::processAmount($this->_priceSet['fields'],
+ CRM_Price_BAO_PriceSet::processAmount($this->_priceSet['fields'],
$this->_params, $lineItem[$priceSetId]
);
//CRM-11529 for quick config backoffice transactions
}
$formValues['contact_id'] = $this->_contactID;
- CRM_Member_BAO_Membership::recordMembershipContribution( $formValues,
- CRM_Core_DAO::$_nullArray,
- $renewMembership->id );
+ CRM_Member_BAO_Membership::recordMembershipContribution(array_merge($formValues, array('membership_id' => $renewMembership->id)));
}
if (CRM_Utils_Array::value('send_receipt', $formValues)) {