_surveyId = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE); $params = array('id' => $this->_surveyId); CRM_Campaign_BAO_Survey::retrieve($params, $surveyInfo); $this->_surveyTitle = $surveyInfo['title']; $this->assign('surveyTitle', $this->_surveyTitle); CRM_Utils_System::setTitle(ts('Delete Survey') . ' - ' . $this->_surveyTitle); } /** * Function to actually build the form * * @return void * @access public */ public function buildQuickForm() { $this->addButtons(array( array( 'type' => 'next', 'name' => ts('Delete'), 'isDefault' => TRUE, ), array( 'type' => 'cancel', 'name' => ts('Cancel'), ), ) ); } /** * Process the form when submitted * * @return void * @access public */ public function postProcess() { if ($this->_surveyId) { CRM_Campaign_BAO_Survey::del($this->_surveyId); CRM_Core_Session::setStatus('', ts("'%1' survey has been deleted.", array(1 => $this->_surveyTitle)), 'success'); CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/campaign', 'reset=1&subPage=survey')); } else { CRM_Core_Error::fatal(ts('Delete action is missing expected survey ID.')); } } }