当前位置: 首页>>代码示例>>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;未经允许,请勿转载。