<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
*/
class CRM_Campaign_BAO_Petition extends CRM_Campaign_BAO_Survey {
/**
- *
*/
- function __construct() {
+ public function __construct() {
parent::__construct();
// expire cookie in one day
$this->cookieExpire = (1 * 60 * 60 * 24);
/**
* Get Petition Details for dashboard.
*
- * @static
*/
- static function getPetitionSummary($params = array(), $onlyCount = FALSE) {
+ public static function getPetitionSummary($params = array(), $onlyCount = FALSE) {
//build the limit and order clause.
$limitClause = $orderByClause = $lookupTableJoins = NULL;
if (!$onlyCount) {
/**
* Get the petition count.
*
- * @static
*/
- static function getPetitionCount() {
+ public static function getPetitionCount() {
$whereClause = 'WHERE ( 1 )';
$queryParams = array();
$petitionTypeID = CRM_Core_OptionGroup::getValue('activity_type', 'petition', 'name');
/**
* Takes an associative array and creates a petition signature activity
*
- * @param array $params (reference ) an assoc array of name/value pairs
+ * @param array $params
+ * (reference ) an assoc array of name/value pairs.
*
* @return CRM_Campaign_BAO_Petition
- * @access public
- * @static
*/
- function createSignature(&$params) {
+ public function createSignature(&$params) {
if (empty($params)) {
return;
}
*
* @return bool
*/
- function confirmSignature($activity_id, $contact_id, $petition_id) {
+ public function confirmSignature($activity_id, $contact_id, $petition_id) {
// change activity status to completed (status_id = 2)
// I wonder why do we need contact_id when we have activity_id anyway? [chastell]
$sql = 'UPDATE civicrm_activity SET status_id = 2 WHERE id = %1';
$params = array(
1 => array($activity_id, 'Integer'),
2 => array($contact_id, 'Integer'),
- 3 => array($sourceID, 'Integer')
+ 3 => array($sourceID, 'Integer'),
);
CRM_Core_DAO::executeQuery($sql, $params);
* @param int $surveyId
*
* @return array
- * @static
*/
- static function getPetitionSignatureTotalbyCountry($surveyId) {
+ public static function getPetitionSignatureTotalbyCountry($surveyId) {
$countries = array();
$sql = "
SELECT count(civicrm_address.country_id) as total,
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$params = array(
1 => array($surveyId, 'Integer'),
- 2 => array($sourceID, 'Integer')
+ 2 => array($sourceID, 'Integer'),
);
$sql .= " GROUP BY civicrm_address.country_id";
$fields = array('total', 'country_id', 'country_iso', 'country');
* @param int $surveyId
*
* @return array
- * @static
*/
- static function getPetitionSignatureTotal($surveyId) {
+ public static function getPetitionSignatureTotal($surveyId) {
$surveyInfo = CRM_Campaign_BAO_Petition::getSurveyInfo((int) $surveyId);
//$activityTypeID = $surveyInfo['activity_type_id'];
$sql = "
* @param int $status_id
*
* @return array
- * @static
*/
- static function getPetitionSignature($surveyId, $status_id = NULL) {
+ public static function getPetitionSignature($surveyId, $status_id = NULL) {
// sql injection protection
$surveyId = (int) $surveyId;
/**
* This function returns all entities assigned to a specific tag
*
- * @param object $tag an object of a tag.
+ * @param object $tag
+ * An object of a tag.
*
- * @return array $contactIds array of contact ids
- * @access public
+ * @return array
+ * array of contact ids
*/
- function getEntitiesByTag($tag) {
+ public function getEntitiesByTag($tag) {
$contactIds = array();
$entityTagDAO = new CRM_Core_DAO_EntityTag();
$entityTagDAO->tag_id = $tag['id'];
* @param int $contactId
*
* @return array
- * @static
*/
- static function checkSignature($surveyId, $contactId) {
+ public static function checkSignature($surveyId, $contactId) {
$surveyInfo = CRM_Campaign_BAO_Petition::getSurveyInfo($surveyId);
$signature = array();
2 => array($surveyId, 'Integer'),
3 => array($surveyInfo['activity_type_id'], 'Integer'),
4 => array($contactId, 'Integer'),
- 5 => array($sourceID, 'Integer')
+ 5 => array($sourceID, 'Integer'),
);
$dao = CRM_Core_DAO::executeQuery($sql, $params);
/**
* Takes an associative array and sends a thank you or email verification email
*
- * @param array $params (reference ) an assoc array of name/value pairs
+ * @param array $params
+ * (reference ) an assoc array of name/value pairs.
*
* @param $sendEmailMode
*
* @throws Exception
* @return void
- @access public
- * @static
*/
public static function sendEmail($params, $sendEmailMode) {
}
}
}
-