_params = $this->get('params'); $this->_lineItem = $this->get('lineItem'); $this->_part = $this->get('part'); $this->_totalAmount = $this->get('totalAmount'); $this->_receiveDate = $this->get('receiveDate'); $this->_trxnId = $this->get('trxnId'); $finalAmount = $this->get('finalAmount'); $this->assign('finalAmount', $finalAmount); $participantInfo = $this->get('participantInfo'); $this->assign('part', $this->_part); $this->assign('participantInfo', $participantInfo); $customGroup = $this->get('customProfile'); $this->assign('customProfile', $customGroup); $this->assign('primaryParticipantProfile', $this->get('primaryParticipantProfile')); $this->assign('addParticipantProfile', $this->get('addParticipantProfile')); CRM_Utils_System::setTitle(CRM_Utils_Array::value('thankyou_title', $this->_values['event'])); } /** * overwrite action, since we are only showing elements in frozen mode * no help display needed * * @return int * @access public */ function getAction() { if ($this->_action & CRM_Core_Action::PREVIEW) { return CRM_Core_Action::VIEW | CRM_Core_Action::PREVIEW; } else { return CRM_Core_Action::VIEW; } } /** * Function to build the form * * @return None * @access public */ public function buildQuickForm() { // Assign the email address from a contact id lookup as in CRM_Event_BAO_Event->sendMail() $primaryContactId = $this->get('primaryContactId'); if ($primaryContactId) { list($displayName, $email) = CRM_Contact_BAO_Contact_Location::getEmailDetails($primaryContactId); $this->assign('email', $email); } $this->assignToTemplate(); if ($this->_priceSetId && !CRM_Core_DAO::getFieldValue('CRM_Price_DAO_Set', $this->_priceSetId, 'is_quick_config')) { $lineItemForTemplate = array(); foreach ($this->_lineItem as $key => $value) { if (!empty($value)) { $lineItemForTemplate[$key] = $value; } } if (!empty($lineItemForTemplate)) { $this->assign('lineItem', $lineItemForTemplate); } } $this->assign('totalAmount', $this->_totalAmount); $hookDiscount = $this->get('hookDiscount'); if ($hookDiscount) { $this->assign('hookDiscount', $hookDiscount); } $this->assign('receive_date', $this->_receiveDate); $this->assign('trxn_id', $this->_trxnId); //cosider total amount. $this->assign('isAmountzero', ($this->_totalAmount <= 0) ? TRUE : FALSE); $this->assign('defaultRole', FALSE); if (CRM_Utils_Array::value('defaultRole', $this->_params[0]) == 1) { $this->assign('defaultRole', TRUE); } $defaults = array(); $fields = array(); if (!empty($this->_fields)) { foreach ($this->_fields as $name => $dontCare) { $fields[$name] = 1; } } $fields['state_province'] = $fields['country'] = $fields['email'] = 1; foreach ($fields as $name => $dontCare) { if (isset($this->_params[0][$name])) { $defaults[$name] = $this->_params[0][$name]; if (substr($name, 0, 7) == 'custom_') { $timeField = "{$name}_time"; if (isset($this->_params[0][$timeField])) { $defaults[$timeField] = $this->_params[0][$timeField]; } } elseif (in_array($name, CRM_Contact_BAO_Contact::$_greetingTypes) && !empty($this->_params[0][$name . '_custom']) ) { $defaults[$name . '_custom'] = $this->_params[0][$name . '_custom']; } } } $this->_submitValues = array_merge($this->_submitValues, $defaults); $this->setDefaults($defaults); $params['entity_id'] = $this->_eventId; $params['entity_table'] = 'civicrm_event'; $data = array(); CRM_Friend_BAO_Friend::retrieve($params, $data); if (CRM_Utils_Array::value('is_active', $data)) { $friendText = $data['title']; $this->assign('friendText', $friendText); if ($this->_action & CRM_Core_Action::PREVIEW) { $url = CRM_Utils_System::url('civicrm/friend', "eid={$this->_eventId}&reset=1&action=preview&pcomponent=event" ); } else { $url = CRM_Utils_System::url('civicrm/friend', "eid={$this->_eventId}&reset=1&pcomponent=event" ); } $this->assign('friendURL', $url); } $this->freeze(); //lets give meaningful status message, CRM-4320. $isOnWaitlist = $isRequireApproval = FALSE; if ($this->_allowWaitlist && !$this->_allowConfirmation) { $isOnWaitlist = TRUE; } if ($this->_requireApproval && !$this->_allowConfirmation) { $isRequireApproval = TRUE; } $this->assign('isOnWaitlist', $isOnWaitlist); $this->assign('isRequireApproval', $isRequireApproval); // find pcp info $dao = new CRM_PCP_DAO_PCPBlock(); $dao->entity_table = 'civicrm_event'; $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=' . $this->_eventId . '&component=event')); $this->assign('pcpLinkText', $dao->link_text); } // Assign Participant Count to Lineitem Table $this->assign('pricesetFieldsCount', CRM_Price_BAO_Set::getPricesetCount($this->_priceSetId)); // can we blow away the session now to prevent hackery $this->controller->reset(); } /** * Function to process the form * * @access public * * @return None */ public function postProcess() {} //end of function /** * Return a descriptive name for the page, used in wizard header * * @return string * @access public */ public function getTitle() { return ts('Thank You Page'); } }