$this->buildCustom($this->_values['custom_pre_id'], 'customPre');
$this->buildCustom($this->_values['custom_post_id'], 'customPost');
+ // CRM-18399: used by template to pass pre profile id as a url arg
+ $this->assign('custom_pre_id', $this->_values['custom_pre_id']);
+
$this->buildComponentForm($this->_id, $this);
// Build payment processor form
$this->buildCustom($this->_values['custom_pre_id'], 'customPre');
$this->buildCustom($this->_values['custom_post_id'], 'customPost');
- if (!empty($this->_fields) && !empty($this->_values['custom_pre_id'])) {
- $profileAddressFields = array();
- foreach ($this->_fields as $key => $value) {
- CRM_Core_BAO_UFField::assignAddressField($key, $profileAddressFields, array(
- 'uf_group_id' => $this->_values['custom_pre_id'],
- ));
- }
- $this->set('profileAddressFields', $profileAddressFields);
- }
+ // CRM-18399: used by template to pass pre profile id as a url arg
+ $this->assign('custom_pre_id', $this->_values['custom_pre_id']);
CRM_Core_Payment_ProcessorForm::buildQuickForm($this);
public function preProcess() {
parent::preProcess();
- // reload and set values of contributionPage
- $id = CRM_Utils_Request::retrieve('id', 'Integer');
- if (!empty($id)) {
- CRM_Contribute_BAO_ContributionPage::setValues($id, $this->_values);
- }
+ $this->_values['custom_pre_id'] = CRM_Utils_Request::retrieve('pre_profile_id', 'Integer', $this);
$this->_paymentProcessorID = CRM_Utils_Request::retrieve('processor_id', 'Integer', CRM_Core_DAO::$_nullObject,
TRUE);
{if $contributionPageID}
{capture assign='contributionPageID'}id={$contributionPageID}&{/capture}
{else}
- {capture assign='contributionPageID'}{/capture}
+ {capture assign='pageID'}{/capture}
+ {/if}
+ {if $custom_pre_id}
+ {capture assign='preProfileID'}pre_profile_id={$custom_pre_id}&{/capture}
+ {else}
+ {capture assign='preProfileID'}{/capture}
{/if}
{if $urlPathVar}
{capture assign='urlPathVar'}{$urlPathVar}&{/capture}
{capture assign='profilePathVar'}{/capture}
{/if}
- var dataUrl = "{crmURL p='civicrm/payment/form' h=0 q="currency=`$currency`&`$urlPathVar``$profilePathVar``$contributionPageID`processor_id="}" + type;
+ var dataUrl = "{crmURL p='civicrm/payment/form' h=0 q="currency=`$currency`&`$urlPathVar``$profilePathVar``$contributionPageID``$preProfileID`processor_id="}" + type;
{literal}
if (typeof(CRM.vars) != "undefined") {
if (typeof(CRM.vars.coreForm) != "undefined") {