crm-10164 : more fixes
authorPratik Joshi <pratik.joshi@webaccess.co.in>
Tue, 25 Jun 2013 12:56:17 +0000 (18:26 +0530)
committerPratik Joshi <pratik.joshi@webaccess.co.in>
Tue, 25 Jun 2013 12:56:17 +0000 (18:26 +0530)
CRM/Event/Form/Registration/Confirm.php
CRM/Event/Form/Registration/ParticipantConfirm.php
CRM/Event/Form/Registration/Register.php
CRM/Event/Form/Registration/ThankYou.php

index 5f44b6f4e3788db700dfeedf22e8631938f03fb1..0ba42e19be07aa755dd51397160ba81d81390b13 100644 (file)
@@ -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;
 
index 6bc39af87db6ac9ea86245faac62a2aa1a0c60bd..cc5678b386b2aa76ad43f84718f61d694fe8aa87 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                               |
+ | CiviCRM version 4.3                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
@@ -56,7 +56,7 @@ class CRM_Event_Form_Registration_ParticipantConfirm extends CRM_Event_Form_Regi
 
     //get the contact and event id and assing to session.
     $values = array();
-    $csContactID = $eventId = NULL;
+    $csContactID = NULL;
     if ($this->_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);
     }
index 1d46ace555aec802ffccaa2cb88a37408f301712..1687abb3c1a498b9c187429eccfe9124b75daf48 100644 (file)
@@ -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
       ) {
index 137da6482451e7e3abf2dff7afe24691e9fdca72..588df3794eb5574678faf359675bb87dcc1b4ba2 100644 (file)
@@ -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);
     }