+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2016 |
+ | Copyright CiviCRM LLC (c) 2004-2017 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2016
+ * @copyright CiviCRM LLC (c) 2004-2017
*/
/**
$this->applyFilter('__ALL__', 'trim');
if (empty($this->_ccid)) {
- $this->add('text', "email-{$this->_bltID}",
- ts('Email Address'),
- array('size' => 30, 'maxlength' => 60, 'class' => 'email'),
- TRUE
- );
- $this->addRule("email-{$this->_bltID}", ts('Email is not valid.'), 'email');
+ if ($this->_emailExists == FALSE) {
+ $this->add('text', "email-{$this->_bltID}",
+ ts('Email Address'),
+ array('size' => 30, 'maxlength' => 60, 'class' => 'email'),
+ TRUE
+ );
+ $this->addRule("email-{$this->_bltID}", ts('Email is not valid.'), 'email');
+ }
}
else {
$this->addElement('hidden', "email-{$this->_bltID}", 1);
$form->assign('is_recur_interval', CRM_Utils_Array::value('is_recur_interval', $form->_values));
$form->assign('is_recur_installments', CRM_Utils_Array::value('is_recur_installments', $form->_values));
+ $paymentObject = $form->getVar('_paymentObject');
+ if ($paymentObject) {
+ $form->assign('recurringHelpText', $paymentObject->getText('contributionPageRecurringHelp', array(
+ 'is_recur_installments' => !empty($form->_values['is_recur_installments']),
+ 'is_email_receipt' => !empty($form->_values['is_email_receipt']),
+ )));
+ }
$form->add('checkbox', 'is_recur', ts('I want to contribute this amount'), NULL);
// For anonymous user check using dedupe rule
// if user has Cancelled Membership
if (!$memContactID) {
- $dedupeParams = CRM_Dedupe_Finder::formatParams($fields, 'Individual');
- $dedupeParams['check_permission'] = FALSE;
- $ids = CRM_Dedupe_Finder::dupesByParams($dedupeParams, 'Individual');
- // if we find more than one contact, use the first one
- $memContactID = CRM_Utils_Array::value(0, $ids);
+ $memContactID = CRM_Contact_BAO_Contact::getFirstDuplicateContact($fields, 'Individual', 'Unsupervised', array(), FALSE);
}
$currentMemberships = CRM_Member_BAO_Membership::getContactsCancelledMembership($memContactID,
$is_test
$fields, $lineItem
);
+ $minAmt = CRM_Core_DAO::getFieldValue('CRM_Price_DAO_PriceSet', $fields['priceSetId'], 'min_amount');
if ($fields['amount'] < 0) {
$errors['_qf_default'] = ts('Contribution can not be less than zero. Please select the options accordingly');
}
+ elseif (!empty($minAmt) && $fields['amount'] < $minAmt) {
+ $errors['_qf_default'] = ts('A minimum amount of %1 should be selected from Contribution(s).', array(
+ 1 => CRM_Utils_Money::format($minAmt),
+ ));
+ }
+
$amount = $fields['amount'];
}
$this->assign('is_pay_later', $params['is_pay_later']);
if ($params['is_pay_later']) {
$this->assign('pay_later_text', $this->_values['pay_later_text']);
- $this->assign('pay_later_receipt', $this->_values['pay_later_receipt']);
+ $this->assign('pay_later_receipt', CRM_Utils_Array::value('pay_later_receipt', $this->_values));
}
if ($this->_membershipBlock['is_separate_payment'] && !empty($params['separate_amount'])) {