*/
/**
- * This class generates form components for processing a ontribution
+ * This class generates form components for processing a contribution
*
*/
class CRM_Contribute_Form_ContributionBase extends CRM_Core_Form {
/**
- * the id of the contribution page that we are proceessing
+ * the id of the contribution page that we are processsing
*
* @var int
* @public
*/
public $_membershipBlock = NULL;
+ /**
+ * Does this form support a separate membership payment
+ * @var bool
+ */
+ protected $_separateMembershipPayment;
/**
* the default values for the form
*
* @var array
* @public
*/
- public $_fields;
+ public $_fields = array();
/**
* The billing location id for this contribiution page
* @access public
*/
function buildCustom($id, $name, $viewOnly = FALSE, $profileContactType = NULL, $fieldTypes = NULL) {
- $stateCountryMap = array();
-
if ($id) {
$contactID = $this->getContactID();
continue;
}
- list($prefixName, $index) = CRM_Utils_System::explode('-', $key, 2);
- if ($prefixName == 'state_province' || $prefixName == 'country' || $prefixName == 'county') {
- if (!array_key_exists($index, $stateCountryMap)) {
- $stateCountryMap[$index] = array();
- }
- $stateCountryMap[$index][$prefixName] = $key;
-
- if ($prefixName == "state_province") {
- if ($profileContactType == 'onbehalf') {
- //CRM-11881: Bypass required-ness check for state/province on Contribution Confirm page
- //as already done during Contribution registration via onBehalf's quickForm
- $field['is_required'] = FALSE;
- }
- else {
- if (count($this->_submitValues)) {
- $locationTypeId = $field['location_type_id'];
- if (array_key_exists("country-{$locationTypeId}", $fields) &&
- array_key_exists("state_province-{$locationTypeId}", $fields) &&
- !empty($this->_submitValues["country-{$locationTypeId}"])) {
- $field['is_required'] =
- CRM_Core_Payment_Form::checkRequiredStateProvince($this, "country-{$locationTypeId}");
- }
- }
- }
- }
- }
-
if ($profileContactType) {
//Since we are showing honoree name separately so we are removing it from honoree profile just for display
$honoreeNamefields = array('prefix_id', 'first_name', 'last_name', 'suffix_id', 'organization_name', 'household_name');
$this->assign($name, $fields);
- CRM_Core_BAO_Address::addStateCountryMap($stateCountryMap);
-
if ($addCaptcha && !$viewOnly) {
$captcha = CRM_Utils_ReCAPTCHA::singleton();
$captcha->add($this);