From af72b8c7ec57d0f47e601d754500884cb00e4f7e Mon Sep 17 00:00:00 2001 From: Pratik Joshi Date: Tue, 25 Jun 2013 18:26:17 +0530 Subject: [PATCH] crm-10164 : more fixes --- CRM/Event/Form/Registration/Confirm.php | 11 ++--------- CRM/Event/Form/Registration/ParticipantConfirm.php | 7 +++---- CRM/Event/Form/Registration/Register.php | 2 -- CRM/Event/Form/Registration/ThankYou.php | 6 ++---- 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/CRM/Event/Form/Registration/Confirm.php b/CRM/Event/Form/Registration/Confirm.php index 5f44b6f4e3..0ba42e19be 100644 --- a/CRM/Event/Form/Registration/Confirm.php +++ b/CRM/Event/Form/Registration/Confirm.php @@ -85,7 +85,6 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { $this->assign('hookDiscount', $this->_params[0]['discount']); } - $config = CRM_Core_Config::singleton(); if ($this->_contributeMode == 'express') { $params = array(); // rfp == redirect from paypal @@ -278,11 +277,6 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { $this->set('totalAmount', $this->_totalAmount); } - $config = CRM_Core_Config::singleton(); - - //$this->buildCustom($this->_values['custom_pre_id'], 'customPre', TRUE); - //$this->buildCustom($this->_values['custom_post_id'], 'customPost', TRUE); - if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_priceSetId, 'is_quick_config')) { $lineItemForTemplate = array(); foreach ($this->_lineItem as $key => $value) { @@ -455,8 +449,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { */ public function postProcess() { $now = date('YmdHis'); - $config = CRM_Core_Config::singleton(); - $session = CRM_Core_Session::singleton(); + $this->_params = $this->get('params'); if (CRM_Utils_Array::value('contact_id', $this->_params[0])) { $contactID = $this->_params[0]['contact_id']; @@ -564,6 +557,7 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { // transactions etc // for things like tell a friend if (!$this->getContactID() && CRM_Utils_Array::value('is_primary', $value)) { + $session = CRM_Core_Session::singleton(); $session->set('transaction.userID', $contactID); } @@ -894,7 +888,6 @@ class CRM_Event_Form_Registration_Confirm extends CRM_Event_Form_Registration { ) { $transaction = new CRM_Core_Transaction(); - $config = CRM_Core_Config::singleton(); $now = date('YmdHis'); $receiptDate = NULL; diff --git a/CRM/Event/Form/Registration/ParticipantConfirm.php b/CRM/Event/Form/Registration/ParticipantConfirm.php index 6bc39af87d..cc5678b386 100644 --- a/CRM/Event/Form/Registration/ParticipantConfirm.php +++ b/CRM/Event/Form/Registration/ParticipantConfirm.php @@ -1,7 +1,7 @@ _participantId) { $params = array('id' => $this->_participantId); CRM_Core_DAO::commonRetrieve('CRM_Event_DAO_Participant', $params, $values, @@ -173,7 +173,6 @@ class CRM_Event_Form_Registration_ParticipantConfirm extends CRM_Event_Form_Regi public function postProcess() { //get the button. $buttonName = $this->controller->getButtonName(); - $eventId = $this->_eventId; $participantId = $this->_participantId; if ($buttonName == '_qf_ParticipantConfirm_next') { @@ -185,7 +184,7 @@ class CRM_Event_Form_Registration_ParticipantConfirm extends CRM_Event_Form_Regi //check user registration status is from pending class $url = CRM_Utils_System::url('civicrm/event/register', - "reset=1&id={$eventId}&participantId={$participantId}" + "reset=1&id={$this->_eventId}&participantId={$participantId}" ); CRM_Utils_System::redirect($url); } diff --git a/CRM/Event/Form/Registration/Register.php b/CRM/Event/Form/Registration/Register.php index 1d46ace555..1687abb3c1 100644 --- a/CRM/Event/Form/Registration/Register.php +++ b/CRM/Event/Form/Registration/Register.php @@ -359,7 +359,6 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { $this->assign('contact_id', $contactID); $this->assign('display_name', CRM_Contact_BAO_Contact::displayName($contactID)); - $config = CRM_Core_Config::singleton(); $this->add('hidden', 'scriptFee', NULL); $this->add('hidden', 'scriptArray', NULL); @@ -858,7 +857,6 @@ class CRM_Event_Form_Registration_Register extends CRM_Event_Form_Registration { } } // return if this is express mode - $config = CRM_Core_Config::singleton(); if ($self->_paymentProcessor && $self->_paymentProcessor['billing_mode'] & CRM_Core_Payment::BILLING_MODE_BUTTON ) { diff --git a/CRM/Event/Form/Registration/ThankYou.php b/CRM/Event/Form/Registration/ThankYou.php index 137da64824..588df3794e 100644 --- a/CRM/Event/Form/Registration/ThankYou.php +++ b/CRM/Event/Form/Registration/ThankYou.php @@ -157,7 +157,6 @@ class CRM_Event_Form_Registration_ThankYou extends CRM_Event_Form_Registration { $this->setDefaults($defaults); - $params['entity_id'] = $this->_eventId; $params['entity_table'] = 'civicrm_event'; $data = array(); @@ -192,15 +191,14 @@ class CRM_Event_Form_Registration_ThankYou extends CRM_Event_Form_Registration { $this->assign('isRequireApproval', $isRequireApproval); // find pcp info - $eventId = $this->_eventId; $dao = new CRM_PCP_DAO_PCPBlock(); $dao->entity_table = 'civicrm_event'; - $dao->entity_id = $eventId; + $dao->entity_id = $this->_eventId; $dao->is_active = 1; $dao->find(TRUE); if ($dao->id) { - $this->assign('pcpLink', CRM_Utils_System::url('civicrm/contribute/campaign', 'action=add&reset=1&pageId=' . $eventId . '&component=event')); + $this->assign('pcpLink', CRM_Utils_System::url('civicrm/contribute/campaign', 'action=add&reset=1&pageId=' . $this->_eventId . '&component=event')); $this->assign('pcpLinkText', $dao->link_text); } -- 2.25.1