* @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);
}
}
- $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;
)
);
}
-
- $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'))) {
CRM_Core_BAO_Address::checkContactSharedAddressFields($fields, $contactID);
}
$this->assign($name, $fields);
- $profileAddressFields = array();
if (is_array($fields)) {
foreach ($fields as $key => $field) {
if ($viewOnly &&
}
$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) {
* @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);
$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;