Example #1
0
 public function preProcess()
 {
     parent::preProcess();
     $this->_context = CRM_Utils_Request::retrieve('context', 'String', $this);
     $this->assign('context', $this->_context);
     $this->_action = CRM_Utils_Request::retrieve('action', 'String', $this);
     if ($this->_action & CRM_Core_Action::UPDATE) {
         CRM_Utils_System::setTitle(ts('Configure Survey') . ' - ' . $this->_surveyTitle);
     }
     // when custom data is included in this page
     if (!empty($_POST['hidden_custom'])) {
         CRM_Custom_Form_CustomData::preProcess($this);
         CRM_Custom_Form_CustomData::buildQuickForm($this);
     }
     if ($this->_name != 'Petition') {
         $url = CRM_Utils_System::url('civicrm/campaign', 'reset=1&subPage=survey');
         CRM_Utils_System::appendBreadCrumb(array(array('title' => ts('Survey Dashboard'), 'url' => $url)));
     }
     $this->_values = $this->get('values');
     if (!is_array($this->_values)) {
         $this->_values = array();
         if ($this->_surveyId) {
             $params = array('id' => $this->_surveyId);
             CRM_Campaign_BAO_Survey::retrieve($params, $this->_values);
         }
         $this->set('values', $this->_values);
     }
     $this->assign('action', $this->_action);
     $this->assign('surveyId', $this->_surveyId);
     // for custom data
     $this->assign('entityID', $this->_surveyId);
 }
Example #2
0
 public function preProcess()
 {
     parent::preProcess();
     if ($this->_action & (CRM_Core_Action::UPDATE | CRM_Core_Action::DELETE)) {
         $this->_surveyId = CRM_Utils_Request::retrieve('id', 'Positive', $this, true);
         if ($this->_action & CRM_Core_Action::UPDATE) {
             CRM_Utils_System::setTitle(ts('Edit Petition'));
         } else {
             CRM_Utils_System::setTitle(ts('Delete Petition'));
         }
     }
     $session = CRM_Core_Session::singleton();
     $url = CRM_Utils_System::url('civicrm/campaign', 'reset=1&subPage=petition');
     $session->pushUserContext($url);
     CRM_Utils_System::appendBreadCrumb(array(array('title' => ts('Petition Dashboard'), 'url' => $url)));
 }
Example #3
0
 public function preProcess()
 {
     parent::preProcess();
     $this->_values = $this->get('values');
     if (!is_array($this->_values)) {
         $this->_values = array();
         if ($this->_surveyId) {
             $params = array('id' => $this->_surveyId);
             CRM_Campaign_BAO_Survey::retrieve($params, $this->_values);
         }
         $this->set('values', $this->_values);
     }
     $query = "SELECT MAX(id) as id, title FROM civicrm_report_instance WHERE name = %1";
     $params = array(1 => array("survey_{$this->_surveyId}", 'String'));
     $result = CRM_Core_DAO::executeQuery($query, $params);
     if ($result->fetch()) {
         $this->_reportId = $result->id;
         $this->_reportTitle = $result->title;
     }
 }