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
21 * This class provides the functionality for cancel registration for event participations
23 class CRM_Event_Form_Task_Cancel
extends CRM_Event_Form_Task
{
26 * Variable to store redirect path.
29 protected $_userContext;
32 * Build all the data structures needed to build the form.
36 public function preProcess() {
37 // initialize the task and row fields
40 $session = CRM_Core_Session
::singleton();
41 $this->_userContext
= $session->readUserContext();
45 * Build the form object.
50 public function buildQuickForm() {
51 CRM_Utils_System
::setTitle(ts('Cancel Registration for Event Participation'));
52 $session = CRM_Core_Session
::singleton();
53 $this->addDefaultButtons(ts('Cancel Registrations'), 'done');
57 * Process the form after the input has been submitted and validated.
62 public function postProcess() {
63 $params = $this->exportValues();
66 foreach ($this->_participantIds
as $participantId) {
67 $value['id'] = $participantId;
69 // Cancelled status id = 4
70 $value['status_id'] = 4;
71 CRM_Event_BAO_Participant
::create($value);