Skip to content
Snippets Groups Projects
Commit 4839c695 authored by Kurund Jalmi's avatar Kurund Jalmi
Browse files

worked on CRM-12681, fixed display of copy checkbox when billing block is build without ajax

parent af04e7c5
Branches
Tags
No related merge requests found
......@@ -365,6 +365,19 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
* @access public
*/
public function buildQuickForm() {
// build profiles first so that we can determine address fields etc
// and then show copy address checkbox
$this->buildCustom($this->_values['custom_pre_id'], 'customPre');
$this->buildCustom($this->_values['custom_post_id'], 'customPost');
if (!empty($this->_fields)) {
$profileAddressFields = array();
foreach ($this->_fields as $key => $value) {
CRM_Core_BAO_UFField::assignAddressField($key, $profileAddressFields);
}
$this->set('profileAddressFields', $profileAddressFields);
}
// Build payment processor form
if ($this->_ppType) {
CRM_Core_Payment_ProcessorForm::buildQuickForm($this);
......@@ -486,17 +499,6 @@ class CRM_Contribute_Form_Contribution_Main extends CRM_Contribute_Form_Contribu
}
}
$this->buildCustom($this->_values['custom_pre_id'], 'customPre');
$this->buildCustom($this->_values['custom_post_id'], 'customPost');
if ( !empty( $this->_fields ) ) {
$profileAddressFields = array();
foreach( $this->_fields as $key => $value ) {
CRM_Core_BAO_UFField::assignAddressField($key, $profileAddressFields);
}
$this->set('profileAddressFields', $profileAddressFields);
}
//to create an cms user
if (!$this->_userID) {
$createCMSUser = FALSE;
......
......@@ -105,16 +105,16 @@ class CRM_Core_Payment_ProcessorForm {
)
);
}
$profileAddressFields = $form->get('profileAddressFields');
if (!empty( $profileAddressFields)) {
$form->assign('profileAddressFields', $profileAddressFields);
}
}
static function buildQuickform(&$form) {
$form->addElement('hidden', 'hidden_processor', 1);
$profileAddressFields = $form->get('profileAddressFields');
if (!empty($profileAddressFields)) {
$form->assign('profileAddressFields', $profileAddressFields);
}
// before we do this lets see if the payment processor has implemented a buildForm method
if (method_exists($form->_paymentProcessor['instance'], 'buildForm') &&
is_callable(array($form->_paymentProcessor['instance'], 'buildForm'))) {
......
......@@ -688,7 +688,6 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
CRM_Core_BAO_Address::checkContactSharedAddressFields($fields, $contactID);
}
$this->assign($name, $fields);
$profileAddressFields = array();
if (is_array($fields)) {
foreach ($fields as $key => $field) {
if ($viewOnly &&
......@@ -715,15 +714,12 @@ class CRM_Event_Form_Registration extends CRM_Core_Form {
}
$stateCountryMap[$index][$prefixName] = $key;
}
CRM_Core_BAO_UFField::assignAddressField($key, $profileAddressFields);
CRM_Core_BAO_UFGroup::buildProfile($this, $field, CRM_Profile_Form::MODE_CREATE, $contactID, TRUE);
$this->_fields[$key] = $field;
}
}
if (!empty($profileAddressFields)) {
$this->set('profileAddressFields', $profileAddressFields);
}
CRM_Core_BAO_Address::addStateCountryMap($stateCountryMap);
if ($addCaptcha && !$viewOnly) {
......
......@@ -333,6 +333,19 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
* @access public
*/
public function buildQuickForm() {
// build profiles first so that we can determine address fields etc
// and then show copy address checkbox
$this->buildCustom($this->_values['custom_pre_id'], 'customPre');
$this->buildCustom($this->_values['custom_post_id'], 'customPost');
if (!empty($this->_fields)) {
$profileAddressFields = array();
foreach ($this->_fields as $key => $value) {
CRM_Core_BAO_UFField::assignAddressField($key, $profileAddressFields);
}
$this->set('profileAddressFields', $profileAddressFields);
}
// Build payment processor form
if ($this->_ppType) {
CRM_Core_Payment_ProcessorForm::buildQuickForm($this);
......@@ -405,9 +418,6 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration {
$this->assign('allowGroupOnWaitlist', $allowGroupOnWaitlist);
$this->assign('isAdditionalParticipants', $isAdditionalParticipants);
$this->buildCustom($this->_values['custom_pre_id'], 'customPre');
$this->buildCustom($this->_values['custom_post_id'], 'customPost');
//lets get js on two different qf elements.
$showHidePayfieldName = NULL;
$showHidePaymentInformation = FALSE;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment