5 +--------------------------------------------------------------------+
6 | CiviCRM version 4.3 |
7 +--------------------------------------------------------------------+
8 | Copyright Tech To The People (c) 2010 |
9 +--------------------------------------------------------------------+
10 | This file is a part of CiviCRM. |
12 | CiviCRM is free software; you can copy, modify, and distribute it |
13 | under the terms of the GNU Affero General Public License |
14 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
16 | CiviCRM is distributed in the hope that it will be useful, but |
17 | WITHOUT ANY WARRANTY; without even the implied warranty of |
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
19 | See the GNU Affero General Public License for more details. |
21 | You should have received a copy of the GNU Affero General Public |
22 | License and the CiviCRM Licensing Exception along |
23 | with this program; if not, contact CiviCRM LLC |
24 | at info[AT]civicrm[DOT]org. If you have questions about the |
25 | GNU Affero General Public License or the licensing of CiviCRM, |
26 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
27 +--------------------------------------------------------------------+
31 * File for the CiviCRM APIv3 Survey Respondant functions
33 * @package CiviCRM_APIv3
34 * @subpackage API_Survey
38 * Include utility functions
40 require_once 'api/v3/utils.php';
41 require_once 'CRM/Utils/Rule.php';
42 require_once 'CRM/Campaign/BAO/Petition.php';
45 * Get the list of signatories
47 * @param array $params (reference ) input parameters
49 * @return array (reference ) contribution_id of created or updated record
52 * @deprecated - api currently not supported
54 function civicrm_api3_survey_respondant_get(&$params) {
56 civicrm_api3_verify_one_mandatory($params, NULL, array('survey_id', 'id'));
58 if (array_key_exists('survey_id', $params)) {
59 $surveyID = $params['survey_id'];
62 $surveyID = $params['id'];
65 $interviewerID = NULL;
66 if (array_key_exists('interviewer_id', $params)) {
67 $interviewerID = $params['interviewer_id'];
71 if (array_key_exists('status_id', $params)) {
72 $statusIds = explode(',', $params['status_id']);
75 $respondants = CRM_Campaign_BAO_Survey
::getSurveyActivities($surveyID, $interviewerID, $statusIds);
77 return (civicrm_api3_create_success($respondants, $params));
81 * @deprecated - api currently not supported
83 function &civicrm_api3_survey_respondant_count($params) {
85 $petition = new CRM_Campaign_BAO_Petition();
86 if (array_key_exists('groupby', $params) &&
87 $params['groupby'] == 'country'
89 $signaturesCount = $petition->getPetitionSignatureTotalbyCountry($params['survey_id']);
92 $signaturesCount = $petition->getPetitionSignatureTotal($params['survey_id']);
94 return ($signaturesCount);