X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FEvent%2FForm%2FSelfSvcUpdate.php;h=cb42b301a0201d330624dfa62801e46f9bdb420d;hb=0f0b0ad290e34b192018b37b7f7cf52766a55715;hp=693c53f19908d92aabeae3e1140e196a2e67342b;hpb=cb4100bc439690c0cd4840286377d1de7cbaf345;p=civicrm-core.git diff --git a/CRM/Event/Form/SelfSvcUpdate.php b/CRM/Event/Form/SelfSvcUpdate.php index 693c53f199..cb42b301a0 100644 --- a/CRM/Event/Form/SelfSvcUpdate.php +++ b/CRM/Event/Form/SelfSvcUpdate.php @@ -1,9 +1,9 @@ _participant_id = CRM_Utils_Request::retrieve('pid', 'Positive', $this, FALSE, NULL, 'REQUEST'); $this->_userChecksum = CRM_Utils_Request::retrieve('cs', 'String', $this, FALSE, NULL, 'REQUEST'); + $this->isBackoffice = CRM_Utils_Request::retrieve('is_backoffice', 'String', $this, FALSE, NULL, 'REQUEST'); $params = array('id' => $this->_participant_id); $this->_participant = CRM_Event_BAO_Participant::getValues($params, $values, $participant); $this->_part_values = $values[$this->_participant_id]; @@ -159,7 +166,7 @@ class CRM_Event_Form_SelfSvcUpdate extends CRM_Core_Form { while ($dao->fetch()) { $details['status'] = $dao->status; $details['role'] = $dao->role; - $details['fee_level'] = $dao->fee_level; + $details['fee_level'] = trim($dao->fee_level, CRM_Core_DAO::VALUE_SEPARATOR); $details['fee_amount'] = $dao->fee_amount; $details['register_date'] = $dao->register_date; $details['event_start_date'] = $dao->start_date; @@ -178,11 +185,11 @@ class CRM_Event_Form_SelfSvcUpdate extends CRM_Core_Form { } $start_time = new Datetime($start_date); $timenow = new Datetime(); - if (!empty($start_time) && $start_time < $timenow) { + if (!$this->isBackoffice && !empty($start_time) && $start_time < $timenow) { $status = ts("Registration for this event cannot be cancelled or transferred once the event has begun. Contact the event organizer if you have questions."); CRM_Core_Error::statusBounce($status, $url, ts('Sorry')); } - if (!empty($time_limit) && $time_limit > 0) { + if (!$this->isBackoffice && !empty($time_limit) && $time_limit > 0) { $interval = $timenow->diff($start_time); $days = $interval->format('%d'); $hours = $interval->format('%h'); @@ -274,11 +281,16 @@ class CRM_Event_Form_SelfSvcUpdate extends CRM_Core_Form { * return @void */ public function transferParticipant($params) { - $transferUrl = 'civicrm/event/form/selfsvctransfer'; - $url = CRM_Utils_System::url('civicrm/event/selfsvctransfer', 'reset=1&action=add&pid=' . $this->_participant_id . '&cs=' . $this->_userChecksum); - $this->controller->setDestination($url); - $session = CRM_Core_Session::singleton(); - $session->replaceUserContext($url); + $isBackOfficeArg = $this->isBackoffice ? '&is_backoffice=1' : ''; + CRM_Utils_System::redirect(CRM_Utils_System::url( + 'civicrm/event/selfsvctransfer', + array( + 'reset' => 1, + 'action' => 'add', + 'pid' => $this->_participant_id, + 'cs' => $this->_userChecksum, + ) + )); } /** @@ -358,6 +370,9 @@ class CRM_Event_Form_SelfSvcUpdate extends CRM_Core_Form { $statusMsg = ts('Event registration information for %1 has been updated.', array(1 => $this->_contact_name)); $statusMsg .= ' ' . ts('A cancellation email has been sent to %1.', array(1 => $this->_contact_email)); CRM_Core_Session::setStatus($statusMsg, ts('Thanks'), 'success'); + if (!empty($this->isBackoffice)) { + return; + } $url = CRM_Utils_System::url('civicrm/event/info', "reset=1&id={$this->_event_id}&noFullMsg=true"); CRM_Utils_System::redirect($url); }