4 +--------------------------------------------------------------------+
5 | CiviCRM version 4.5 |
6 +--------------------------------------------------------------------+
7 | Copyright Tech To The People (c) 2010 |
8 +--------------------------------------------------------------------+
9 | This file is a part of CiviCRM. |
11 | CiviCRM is free software; you can copy, modify, and distribute it |
12 | under the terms of the GNU Affero General Public License |
13 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
15 | CiviCRM is distributed in the hope that it will be useful, but |
16 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. |
20 | You should have received a copy of the GNU Affero General Public |
21 | License and the CiviCRM Licensing Exception along |
22 | with this program; if not, contact CiviCRM LLC |
23 | at info[AT]civicrm[DOT]org. If you have questions about the |
24 | GNU Affero General Public License or the licensing of CiviCRM, |
25 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
26 +--------------------------------------------------------------------+
30 * File for the CiviCRM APIv3 Survey Respondant functions
32 * @package CiviCRM_APIv3
33 * @subpackage API_Survey
37 * Get the list of signatories
39 * @param array $params (reference ) input parameters
41 * @return array (reference ) contribution_id of created or updated record
44 * @deprecated - api currently not supported
46 function civicrm_api3_survey_respondant_get(&$params) {
48 civicrm_api3_verify_one_mandatory($params, NULL, array('survey_id', 'id'));
50 if (array_key_exists('survey_id', $params)) {
51 $surveyID = $params['survey_id'];
54 $surveyID = $params['id'];
57 $interviewerID = NULL;
58 if (array_key_exists('interviewer_id', $params)) {
59 $interviewerID = $params['interviewer_id'];
63 if (array_key_exists('status_id', $params)) {
64 $statusIds = explode(',', $params['status_id']);
67 $respondants = CRM_Campaign_BAO_Survey
::getSurveyActivities($surveyID, $interviewerID, $statusIds);
69 return (civicrm_api3_create_success($respondants, $params));
73 * @deprecated - api currently not supported
75 function &civicrm_api3_survey_respondant_count($params) {
77 $petition = new CRM_Campaign_BAO_Petition();
78 if (array_key_exists('groupby', $params) &&
79 $params['groupby'] == 'country'
81 $signaturesCount = $petition->getPetitionSignatureTotalbyCountry($params['survey_id']);
84 $signaturesCount = $petition->getPetitionSignatureTotal($params['survey_id']);
86 return ($signaturesCount);