_userContext = $session->readUserContext(); } /** * Build the form object. * * * @return void */ public function buildQuickForm() { CRM_Utils_System::setTitle(ts('Cancel Registration for Event Participation')); $session = CRM_Core_Session::singleton(); $this->addDefaultButtons(ts('Cancel Registrations'), 'done'); } /** * Process the form after the input has been submitted and validated. * * * @return void */ public function postProcess() { $params = $this->exportValues(); $value = array(); foreach ($this->_participantIds as $participantId) { $value['id'] = $participantId; // Cancelled status id = 4 $value['status_id'] = 4; CRM_Event_BAO_Participant::create($value); } } }