| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
$params[$fld] = CRM_Utils_Array::value($fld, $_POST);
}
$params['details'] = CRM_Utils_Array::value('note', $_POST);
- $voterId = $params['voter_id'];
- $activityId = $params['activity_id'];
+ $voterId = $params['voter_id'];
+ $activityId = $params['activity_id'];
$customKey = "field_{$voterId}_custom";
foreach ($_POST as $key => $value) {
public static function loadOptionGroupDetails() {
- $id = CRM_Utils_Array::value('option_group_id', $_POST);
- $status = 'fail';
+ $id = CRM_Utils_Array::value('option_group_id', $_POST);
+ $status = 'fail';
$opValues = array();
if ($id) {
$surveyId = CRM_Utils_Array::value('survey_id', $_POST);
if ($surveyId) {
- $survey = new CRM_Campaign_DAO_Survey();
- $survey->id = $surveyId;
+ $survey = new CRM_Campaign_DAO_Survey();
+ $survey->id = $surveyId;
$survey->result_id = $id;
if ($survey->find(TRUE)) {
if ($survey->recontact_interval) {
//format multi-select group and contact types.
foreach (array(
- 'group', 'contact_type') as $param) {
+ 'group',
+ 'contact_type',
+ ) as $param) {
$paramValue = CRM_Utils_Array::value($param, $params);
if ($paramValue) {
unset($params[$param]);
$voterClauseParams = array();
foreach (array(
- 'campaign_survey_id', 'survey_interviewer_id', 'campaign_search_voter_for') as $fld) {
+ 'campaign_survey_id',
+ 'survey_interviewer_id',
+ 'campaign_search_voter_for',
+ ) as $fld) {
$voterClauseParams[$fld] = CRM_Utils_Array::value($fld, $params);
}
// get the data table params.
$dataTableParams = array(
'sEcho' => array(
- 'name' => 'sEcho',
+ 'name' => 'sEcho',
'type' => 'Integer',
'default' => 0,
),
$iTotal = $searchCount;
$selectorCols = array(
- 'contact_type', 'sort_name', 'street_address',
- 'street_name', 'street_number', 'street_unit',
+ 'contact_type',
+ 'sort_name',
+ 'street_address',
+ 'street_name',
+ 'street_number',
+ 'street_unit',
);
$extraVoterColName = 'is_interview_conducted';
$voterExtraColHtml .= " <span id='success_msg_{$contactID}' class='ok' style='display:none;'>$msg</span>";
}
elseif ($searchVoterFor == 'gotv') {
- $surveyActId = $result->survey_activity_id;
+ $surveyActId = $result->survey_activity_id;
$voterExtraColHtml = '<input type="checkbox" id="survey_activity[' . $surveyActId . ']" name="survey_activity[' . $surveyActId . ']" value=' . $surveyActId . ' onClick="processVoterData( this, \'gotv\' );" />';
- $msg = ts('Vote Recorded.');
+ $msg = ts('Vote Recorded.');
$voterExtraColHtml .= " <span id='success_msg_{$surveyActId}' class='ok' style='display:none;'>$msg</span>";
}
else {
- $surveyActId = $result->survey_activity_id;
+ $surveyActId = $result->survey_activity_id;
$voterExtraColHtml = '<input type="checkbox" id="survey_activity[' . $surveyActId . ']" name="survey_activity[' . $surveyActId . ']" value=' . $surveyActId . ' onClick="processVoterData( this, \'release\' );" />';
- $msg = ts('Vote Recorded.');
+ $msg = ts('Vote Recorded.');
$voterExtraColHtml .= " <span id='success_msg_{$surveyActId}' class='ok' style='display:none;'>$msg</span>";
}
$searchRows[$contactID][$extraVoterColName] = $voterExtraColHtml;
$iFilteredTotal = $iTotal;
+ header('Content-Type: application/json');
echo CRM_Utils_JSON::encodeDataTableSelector($searchRows, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
CRM_Utils_System::civiExit();
}
}
}
if ($createActivity) {
- $isReserved = CRM_Utils_String::strtoboolstr(CRM_Utils_Type::escape($_POST['isReserved'], 'String'));
- $activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
+ $isReserved = CRM_Utils_String::strtoboolstr(CRM_Utils_Type::escape($_POST['isReserved'], 'String'));
+ $activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
$scheduledStatusId = array_search('Scheduled', $activityStatus);
if ($isReserved) {
$surveyValues = array();
public function allActiveCampaigns() {
$currentCampaigns = CRM_Campaign_BAO_Campaign::getCampaigns();
- $campaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, TRUE, FALSE, TRUE);
- $options = array(
+ $campaigns = CRM_Campaign_BAO_Campaign::getCampaigns(NULL, NULL, TRUE, FALSE, TRUE);
+ $options = array(
array(
- 'value' => '',
+ 'value' => '',
'title' => ts('- select -'),
- ));
+ ),
+ );
foreach ($campaigns as $value => $title) {
$class = NULL;
if (!array_key_exists($value, $currentCampaigns)) {
}
$groups = array(
array(
- 'value' => '',
+ 'value' => '',
'title' => ts('- select -'),
- ));
+ ),
+ );
foreach ($campGroups as $grpId => $title) {
$groups[] = array(
'value' => $grpId,
/**
* Retrieve campaigns as for campaign dashboard.
*
- **/
+ */
public function campaignList() {
//get the search criteria params.
$searchParams = explode(',', CRM_Utils_Array::value('searchCriteria', $_POST));
// get the data table params.
$dataTableParams = array(
'sEcho' => array(
- 'name' => 'sEcho',
+ 'name' => 'sEcho',
'type' => 'Integer',
'default' => 0,
),
}
}
foreach (array(
- 'sort', 'offset', 'rowCount', 'sortOrder') as $sortParam) {
+ 'sort',
+ 'offset',
+ 'rowCount',
+ 'sortOrder',
+ ) as $sortParam) {
$params[$sortParam] = $$sortParam;
}
$searchCount = CRM_Campaign_BAO_Campaign::getCampaignSummary($params, TRUE);
- $campaigns = CRM_Campaign_Page_DashBoard::getCampaignSummary($params);
- $iTotal = $searchCount;
+ $campaigns = CRM_Campaign_Page_DashBoard::getCampaignSummary($params);
+ $iTotal = $searchCount;
if ($searchCount > 0) {
if ($searchCount < $offset) {
$iFilteredTotal = $iTotal;
+ header('Content-Type: application/json');
echo CRM_Utils_JSON::encodeDataTableSelector($searchRows, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
CRM_Utils_System::civiExit();
}
/**
* Retrieve survey for survey dashboard.
*
- **/
+ */
public function surveyList() {
//get the search criteria params.
$searchParams = explode(',', CRM_Utils_Array::value('searchCriteria', $_POST));
// get the data table params.
$dataTableParams = array(
'sEcho' => array(
- 'name' => 'sEcho',
+ 'name' => 'sEcho',
'type' => 'Integer',
'default' => 0,
),
}
}
foreach (array(
- 'sort', 'offset', 'rowCount', 'sortOrder') as $sortParam) {
+ 'sort',
+ 'offset',
+ 'rowCount',
+ 'sortOrder',
+ ) as $sortParam) {
$params[$sortParam] = $$sortParam;
}
- $surveys = CRM_Campaign_Page_DashBoard::getSurveySummary($params);
+ $surveys = CRM_Campaign_Page_DashBoard::getSurveySummary($params);
$searchCount = CRM_Campaign_BAO_Survey::getSurveySummary($params, TRUE);
- $iTotal = $searchCount;
+ $iTotal = $searchCount;
if ($searchCount > 0) {
if ($searchCount < $offset) {
$iFilteredTotal = $iTotal;
+ header('Content-Type: application/json');
echo CRM_Utils_JSON::encodeDataTableSelector($searchRows, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
CRM_Utils_System::civiExit();
}
/**
* Retrieve petitions for petition dashboard.
*
- **/
+ */
public function petitionList() {
//get the search criteria params.
$searchParams = explode(',', CRM_Utils_Array::value('searchCriteria', $_POST));
// get the data table params.
$dataTableParams = array(
'sEcho' => array(
- 'name' => 'sEcho',
+ 'name' => 'sEcho',
'type' => 'Integer',
'default' => 0,
),
}
}
foreach (array(
- 'sort', 'offset', 'rowCount', 'sortOrder') as $sortParam) {
+ 'sort',
+ 'offset',
+ 'rowCount',
+ 'sortOrder',
+ ) as $sortParam) {
$params[$sortParam] = $$sortParam;
}
- $petitions = CRM_Campaign_Page_DashBoard::getPetitionSummary($params);
+ $petitions = CRM_Campaign_Page_DashBoard::getPetitionSummary($params);
$searchCount = CRM_Campaign_BAO_Petition::getPetitionSummary($params, TRUE);
- $iTotal = $searchCount;
+ $iTotal = $searchCount;
if ($searchCount > 0) {
if ($searchCount < $offset) {
$iFilteredTotal = $iTotal;
+ header('Content-Type: application/json');
echo CRM_Utils_JSON::encodeDataTableSelector($searchRows, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
CRM_Utils_System::civiExit();
}
+
}