$defaults['hidden_AdditionalDetail'] = 1;
}
- $paneNames = [];
if (empty($this->_payNow)) {
- $paneNames[ts('Additional Details')] = 'AdditionalDetail';
- }
-
- //Add Premium pane only if Premium is exists.
- $dao = new CRM_Contribute_DAO_Product();
- $dao->is_active = 1;
+ $allPanes = [ts('Additional Details') => $this->generatePane('AdditionalDetail', $defaults)];
+ //Add Premium pane only if Premium is exists.
+ $dao = new CRM_Contribute_DAO_Product();
+ $dao->is_active = 1;
- if ($dao->find(TRUE) && empty($this->_payNow)) {
- $paneNames[ts('Premium Information')] = 'Premium';
+ if ($dao->find(TRUE)) {
+ $allPanes[ts('Premium Information')] = $this->generatePane('Premium', $defaults);
+ }
}
+ $this->assign('allPanes', $allPanes ?: []);
$this->payment_instrument_id = $defaults['payment_instrument_id'] ?? $this->getDefaultPaymentInstrumentId();
CRM_Core_Payment_Form::buildPaymentForm($this, $this->_paymentProcessor, FALSE, TRUE, $this->payment_instrument_id);
}
$this->addPaymentProcessorSelect(FALSE, $buildRecurBlock);
- foreach ($paneNames as $name => $type) {
- $allPanes[$name] = $this->generatePane($type, $defaults);
- }
-
$qfKey = $this->controller->_key;
$this->assign('qfKey', $qfKey);
- $this->assign('allPanes', $allPanes);
$this->addFormRule(['CRM_Contribute_Form_Contribution', 'formRule'], $this);
$this->assign('formType', $this->_formType);
* This appears to mean 'there is a pane to show'.
*
* @param string $type
- * Type of Pane - this is generally used to determine the function name used to build it
- * - e.g CreditCard, AdditionalDetail
+ * Type of Pane - only options are AdditionalDetail or Premium
* @param array $defaults
*
* @return array
$urlParams .= "&mode={$this->_mode}";
}
- $open = 'false';
- if ($type == 'CreditCard' ||
- $type == 'DirectDebit'
- ) {
- $open = 'true';
- }
-
$pane = [
'url' => CRM_Utils_System::url('civicrm/contact/view/contribution', $urlParams),
- 'open' => $open,
+ 'open' => 'false',
'id' => $type,
];
$this->assign('showAdditionalInfo', TRUE);
$pane['open'] = 'true';
}
-
- if ($type == 'CreditCard' || $type == 'DirectDebit') {
- // @todo would be good to align tpl name with form name...
- // @todo document why this hidden variable is required.
- $this->add('hidden', 'hidden_' . $type, 1);
- return $pane;
- }
- else {
- $additionalInfoFormFunction = 'build' . $type;
- CRM_Contribute_Form_AdditionalInfo::$additionalInfoFormFunction($this);
- return $pane;
- }
+ $additionalInfoFormFunction = 'build' . $type;
+ CRM_Contribute_Form_AdditionalInfo::$additionalInfoFormFunction($this);
+ return $pane;
}
/**
$params = array_merge($billingParams, [
'qfKey' => '08ed21c7ca00a1f7d32fff2488596ef7_4454',
- 'hidden_CreditCard' => 1,
'is_recur' => 1,
'frequency_interval' => 1,
'frequency_unit' => 'month',
$params = [
'qfKey' => '00ed21c7ca00a1f7d555555596ef7_4454',
- 'hidden_CreditCard' => 1,
'billing_first_name' => $firstName,
'billing_middle_name' => '',
'billing_last_name' => $lastName,