<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.4 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
*
*/
}
}
- if (isset($_POST['field']) &&
- CRM_Utils_Array::value($voterId, $_POST['field']) &&
+ if (isset($_POST['field']) && !empty($_POST['field'][$voterId]) &&
is_array($_POST['field'][$voterId])
) {
foreach ($_POST['field'][$voterId] as $fieldKey => $value) {
$errors = CRM_Core_BAO_CustomField::validateCustomData($params);
if (is_array($errors) && !empty($errors)) {
$result['errors'] = $errors;
- echo json_encode($result);
- CRM_Utils_System::civiExit();
+ CRM_Utils_JSON::output($result);
}
//process the response/interview data.
$result['status'] = 'success';
}
- echo json_encode($result);
-
- CRM_Utils_System::civiExit();
+ CRM_Utils_JSON::output($result);
}
static function loadOptionGroupDetails() {
'result' => $opValues,
);
- echo json_encode($result);
- CRM_Utils_System::civiExit();
+ CRM_Utils_JSON::output($result);
}
function voterList() {
$params = $searchRows = array();
foreach ($searchParams as $param) {
- if (CRM_Utils_Array::value($param, $_POST)) {
+ if (!empty($_POST[$param])) {
$params[$param] = $_POST[$param];
}
}
$interviewerId = $surveyTypeId = $surveyId = NULL;
$searchVoterFor = $params['campaign_search_voter_for'];
if ($searchVoterFor == 'reserve') {
- if (CRM_Utils_Array::value('campaign_survey_id', $params)) {
+ if (!empty($params['campaign_survey_id'])) {
$survey = new CRM_Campaign_DAO_Survey();
$survey->id = $surveyId = $params['campaign_survey_id'];
$survey->selectAdd('campaign_id, activity_type_id');
);
foreach ($dataTableParams as $pName => $pValues) {
$$pName = $pValues['default'];
- if (CRM_Utils_Array::value($pValues['name'], $_POST)) {
+ if (!empty($_POST[$pValues['name']])) {
$$pName = CRM_Utils_Type::escape($_POST[$pValues['name']], $pValues['type']);
if ($pName == 'sort')$$pName = $selectorCols[$$pName];
}
elseif ($operation == 'reserve') {
$activityId = NULL;
$createActivity = TRUE;
- if (CRM_Utils_Array::value('activity_id', $_POST)) {
+ if (!empty($_POST['activity_id'])) {
$activityId = CRM_Utils_Type::escape($_POST['activity_id'], 'Integer');
if ($activityId) {
$createActivity = FALSE;
}
}
- echo json_encode(array('status' => $status));
- CRM_Utils_System::civiExit();
+ CRM_Utils_JSON::output(array('status' => $status));
}
function allActiveCampaigns() {
'campaigns' => $options,
);
- echo json_encode($results);
-
- CRM_Utils_System::civiExit();
+ CRM_Utils_JSON::output($results);
}
function campaignGroups() {
'groups' => $groups,
);
- echo json_encode($results);
-
- CRM_Utils_System::civiExit();
+ CRM_Utils_JSON::output($results);
}
/**
$params = $searchRows = array();
foreach ($searchParams as $param) {
- if (CRM_Utils_Array::value($param, $_POST)) {
+ if (!empty($_POST[$param])) {
$params[$param] = $_POST[$param];
}
}
);
foreach ($dataTableParams as $pName => $pValues) {
$$pName = $pValues['default'];
- if (CRM_Utils_Array::value($pValues['name'], $_POST)) {
+ if (!empty($_POST[$pValues['name']])) {
$$pName = CRM_Utils_Type::escape($_POST[$pValues['name']], $pValues['type']);
if ($pName == 'sort') {
$$pName = $selectorCols[$$pName];
$params = $searchRows = array();
foreach ($searchParams as $param) {
- if (CRM_Utils_Array::value($param, $_POST)) {
+ if (!empty($_POST[$param])) {
$params[$param] = $_POST[$param];
}
}
);
foreach ($dataTableParams as $pName => $pValues) {
$$pName = $pValues['default'];
- if (CRM_Utils_Array::value($pValues['name'], $_POST)) {
+ if (!empty($_POST[$pValues['name']])) {
$$pName = CRM_Utils_Type::escape($_POST[$pValues['name']], $pValues['type']);
if ($pName == 'sort') {
$$pName = $selectorCols[$$pName];
$params = $searchRows = array();
foreach ($searchParams as $param) {
- if (CRM_Utils_Array::value($param, $_POST)) {
+ if (!empty($_POST[$param])) {
$params[$param] = $_POST[$param];
}
}
);
foreach ($dataTableParams as $pName => $pValues) {
$$pName = $pValues['default'];
- if (CRM_Utils_Array::value($pValues['name'], $_POST)) {
+ if (!empty($_POST[$pValues['name']])) {
$$pName = CRM_Utils_Type::escape($_POST[$pValues['name']], $pValues['type']);
if ($pName == 'sort') {
$$pName = $selectorCols[$$pName];