_id = CRM_Utils_Request::retrieve('id', 'Positive', $this, TRUE); $this->_eid = CRM_Utils_Request::retrieve('eid', 'Positive', $this, TRUE); } /** * Function to actually build the form * * @return None * @access public */ public function buildQuickForm() { $this->addButtons(array( array( 'type' => 'next', 'name' => ts('Delete'), 'subName' => 'view', 'isDefault' => TRUE, ), array( 'type' => 'cancel', 'name' => ts('Cancel'), ), )); } /** * Process the form when submitted * * @return void * @access public */ public function postProcess() { CRM_Core_BAO_File::delete($this->_id, $this->_eid); CRM_Core_Session::setStatus(ts('The attached file has been deleted.'), ts('Deleted'), 'success'); $session = CRM_Core_Session::singleton(); $toUrl = $session->popUserContext(); CRM_Utils_System::redirect($toUrl); } }