本文整理汇总了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');
}
示例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'));
}