Пример #1
0
 /**
  * @return mixed
  */
 public function browseSurvey()
 {
     // ensure valid javascript - this must have a value set
     $this->assign('searchParams', json_encode(NULL));
     $this->assign('surveyTypes', json_encode(NULL));
     $this->assign('surveyCampaigns', json_encode(NULL));
     $this->assign('addSurveyUrl', CRM_Utils_System::url('civicrm/survey/add', 'reset=1&action=add'));
     $surveyCount = CRM_Campaign_BAO_Survey::getSurveyCount();
     //don't load find interface when no survey in db.
     if (!$surveyCount) {
         $this->assign('hasSurveys', FALSE);
         return;
     }
     $this->assign('hasSurveys', TRUE);
     //build the ajaxify survey search and selector.
     $controller = new CRM_Core_Controller_Simple('CRM_Campaign_Form_Search_Survey', ts('Search Survey'));
     $controller->set('searchTab', 'survey');
     $controller->setEmbedded(TRUE);
     $controller->process();
     return $controller->run();
 }