當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Campaign_BAO_Survey::getSurveyActivities方法代碼示例

本文整理匯總了PHP中CRM_Campaign_BAO_Survey::getSurveyActivities方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Campaign_BAO_Survey::getSurveyActivities方法的具體用法?PHP CRM_Campaign_BAO_Survey::getSurveyActivities怎麽用?PHP CRM_Campaign_BAO_Survey::getSurveyActivities使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRM_Campaign_BAO_Survey的用法示例。


在下文中一共展示了CRM_Campaign_BAO_Survey::getSurveyActivities方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: civicrm_api3_survey_respondant_get

/**
 * Get the list of signatories.
 *
 * @deprecated - api currently not supported
 *
 * @param array $params
 *   input parameters.
 *
 * @return array
 */
function civicrm_api3_survey_respondant_get(&$params)
{
    civicrm_api3_verify_one_mandatory($params, NULL, array('survey_id', 'id'));
    if (array_key_exists('survey_id', $params)) {
        $surveyID = $params['survey_id'];
    } else {
        $surveyID = $params['id'];
    }
    $interviewerID = NULL;
    if (array_key_exists('interviewer_id', $params)) {
        $interviewerID = $params['interviewer_id'];
    }
    $statusIds = array();
    if (array_key_exists('status_id', $params)) {
        $statusIds = explode(',', $params['status_id']);
    }
    $respondants = CRM_Campaign_BAO_Survey::getSurveyActivities($surveyID, $interviewerID, $statusIds);
    return civicrm_api3_create_success($respondants, $params, 'SurveyRespondant', 'get');
}
開發者ID:FundingWorks,項目名稱:civicrm-core,代碼行數:29,代碼來源:SurveyRespondant.php

示例2: preProcess

 /**
  * Build all the data structures needed to build the form.
  */
 public function preProcess()
 {
     parent::preProcess();
     //get the survey id from user submitted values.
     $this->_surveyId = $this->get('surveyId');
     $this->_interviewerId = $this->get('interviewerId');
     if (!$this->_surveyId) {
         CRM_Core_Error::statusBounce(ts("Could not find Survey Id."));
     }
     if (!$this->_interviewerId) {
         CRM_Core_Error::statusBounce(ts("Missing Interviewer contact."));
     }
     if (!is_array($this->_contactIds) || empty($this->_contactIds)) {
         CRM_Core_Error::statusBounce(ts("Could not find contacts for reservation."));
     }
     $params = array('id' => $this->_surveyId);
     CRM_Campaign_BAO_Survey::retrieve($params, $this->_surveyDetails);
     //get the survey activities.
     $activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
     $statusIds = array();
     foreach (array('Scheduled') as $name) {
         if ($statusId = array_search($name, $activityStatus)) {
             $statusIds[] = $statusId;
         }
     }
     // these are the activities count that are linked to the current
     // interviewer and current survey and not the list of ALL survey activities
     $this->_numVoters = CRM_Campaign_BAO_Survey::getSurveyActivities($this->_surveyId, $this->_interviewerId, $statusIds, NULL, TRUE);
     //validate the selected survey.
     $this->validateSurvey();
     $this->assign('surveyTitle', $this->_surveyDetails['title']);
     $this->assign('activityType', $this->_surveyDetails['activity_type_id']);
     $this->assign('surveyId', $this->_surveyId);
     //append breadcrumb to survey dashboard.
     if (CRM_Campaign_BAO_Campaign::accessCampaign()) {
         $url = CRM_Utils_System::url('civicrm/campaign', 'reset=1&subPage=survey');
         CRM_Utils_System::appendBreadCrumb(array(array('title' => ts('Survey(s)'), 'url' => $url)));
     }
     //set the title.
     CRM_Utils_System::setTitle(ts('Reserve Respondents'));
 }
開發者ID:kcristiano,項目名稱:civicrm-core,代碼行數:44,代碼來源:Reserve.php


注:本文中的CRM_Campaign_BAO_Survey::getSurveyActivities方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。