3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 * This class provides the functionality for cancel registration for event participations
21 class CRM_Event_Form_Task_Cancel
extends CRM_Event_Form_Task
{
24 * Variable to store redirect path.
27 protected $_userContext;
30 * Build all the data structures needed to build the form.
34 public function preProcess() {
35 // initialize the task and row fields
38 $session = CRM_Core_Session
::singleton();
39 $this->_userContext
= $session->readUserContext();
43 * Build the form object.
48 public function buildQuickForm() {
49 $this->setTitle(ts('Cancel Registration for Event Participation'));
50 $session = CRM_Core_Session
::singleton();
51 $this->addDefaultButtons(ts('Cancel Registrations'), 'done');
55 * Process the form after the input has been submitted and validated.
60 public function postProcess() {
61 $params = $this->exportValues();
64 foreach ($this->_participantIds
as $participantId) {
65 $value['id'] = $participantId;
67 // Cancelled status id = 4
68 $value['status_id'] = 4;
69 CRM_Event_BAO_Participant
::create($value);