/**
* Set variables up before form is built.
*
+ * @deprecated since 5.69 will be removed around 5.74
+ *
* @param CRM_Core_Form $form
*
* @throws \CRM_Core_Exception
*/
public static function preProcess(&$form) {
+ CRM_Core_Error::deprecatedFunctionWarning('no alternative');
//as when call come from register.php
if (!$form->_eventId) {
$form->_eventId = CRM_Utils_Request::retrieve('eventId', 'Positive', $form);
if (CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $_GET['eventId'], 'is_monetary')) {
$this->assign('feeBlockPaid', TRUE);
}
- CRM_Event_Form_EventFees::preProcess($this);
return;
}
if ($this->_submitValues['event_id']) {
$this->_eventId = (int) $this->_submitValues['event_id'];
}
- CRM_Event_Form_EventFees::preProcess($this);
$this->buildEventFeeForm($this);
CRM_Event_Form_EventFees::setDefaultValues($this);
}
* @throws \Exception
*/
public function buildEventFeeForm($form) {
+ //as when call come from register.php
+ if (!$form->_eventId) {
+ $form->_eventId = CRM_Utils_Request::retrieve('eventId', 'Positive', $form);
+ }
+
+ $form->_pId = CRM_Utils_Request::retrieve('participantId', 'Positive', $form);
+ $form->_discountId = CRM_Utils_Request::retrieve('discountId', 'Positive', $form);
+
+ //CRM-6907 set event specific currency.
+ if ($form->_eventId &&
+ ($currency = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $form->_eventId, 'currency'))
+ ) {
+ CRM_Core_Config::singleton()->defaultCurrency = $currency;
+ }
if ($form->_eventId) {
$form->_isPaidEvent = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $form->_eventId, 'is_monetary');
if ($form->_isPaidEvent) {