$this->assign('cdType', TRUE);
return CRM_Custom_Form_CustomData::preProcess($this);
}
-
+ // This string makes up part of the class names, differentiating them (not sure why) from the membership fields.
+ $this->assign('formClass', 'membership');
parent::preProcess();
// get price set id.
$this->_priceSetId = CRM_Utils_Array::value('priceSetId', $_GET);
array('onclick' => "buildReceiptANDNotice( );")
);
+ $this->assignPaymentRelatedVariables();
+
if ($this->_mode) {
- //get the valid recurring processors.
- $test = strtolower($this->_mode) == 'test' ? TRUE : FALSE;
- $recurring = CRM_Core_PseudoConstant::paymentProcessor(FALSE, $test, 'is_recur = 1');
- $recurProcessor = array_intersect_assoc($this->_processors, $recurring);
- $autoRenew = array();
- if (!empty($recurProcessor)) {
+ if (!empty($this->_recurPaymentProcessors)) {
if (!empty($membershipType)) {
$sql = '
SELECT id,
'onChange' =>
"CRM.buildCustomData( 'Membership', this.value ); buildAutoRenew(this.value, null );",
);
+ $this->assign('allowAutoRenew', TRUE);
}
}
}
- $allowAutoRenew = FALSE;
- if ($this->_mode && !empty($recurProcessor)) {
- $allowAutoRenew = TRUE;
- }
- $this->assign('allowAutoRenew', $allowAutoRenew);
+
$this->assign('autoRenewOptions', json_encode($autoRenew));
- $this->assign('recurProcessor', json_encode($recurProcessor));
// for max_related: a little JS to show/hide & set default value
$memTypeJs['onChange'] = "buildMaxRelated(this.value,true); " . $memTypeJs['onChange'];
array('' => ts('- select -')) + CRM_Contribute_PseudoConstant::financialType()
);
- //CRM-10223 - allow contribution to be recorded against different contact
- // causes a conflict in standalone mode so skip in standalone for now
$this->addElement('checkbox', 'is_different_contribution_contact', ts('Record Payment from a Different Contact?'));
+
$this->addSelect('soft_credit_type_id', array('entity' => 'contribution_soft'));
$this->addEntityRef('soft_credit_contact_id', ts('Payment From'), array('create' => TRUE));
$this->add('select', 'from_email_address', ts('Receipt From'), $this->_fromEmails);
- $this->add('textarea', 'receipt_text_signup', ts('Receipt Message'));
+ $this->add('textarea', 'receipt_text', ts('Receipt Message'));
// Retrieve the name and email of the contact - this will be the TO for receipt email
if ($this->_contactID) {
if (!empty($formValues['send_receipt']) && $receiptSend) {
$formValues['contact_id'] = $this->_contactID;
$formValues['contribution_id'] = $contributionId;
-
+ // We really don't need a distinct receipt_text_signup vs receipt_text_renewal as they are
+ // handled in the receipt. But by setting one we avoid breaking templates for now
+ // although at some point we should switch in the templates.
+ $formValues['receipt_text_signup'] = $formValues['receipt_text'];
// send email receipt
$mailSend = self::emailReceipt($this, $formValues, $membership);
}