Commit f157740d authored by Seamus Lee's avatar Seamus Lee

(NFC) Update CRM/Badge CRM/Campaign CRM/Case to be up to date with a newer coder

parent fb1a4c6f
......@@ -177,7 +177,7 @@ class CRM_Badge_BAO_Layout extends CRM_Core_DAO_PrintLabel {
* @return array
* associated array of decoded elements
*/
static public function getDecodedData($jsonData) {
public static function getDecodedData($jsonData) {
return json_decode($jsonData, TRUE);
}
......
......@@ -32,6 +32,7 @@
*
*/
class CRM_Badge_Page_AJAX {
public static function getImageProp() {
$img = $_GET['img'];
list($w, $h) = CRM_Badge_BAO_Badge::getImageProperties($img);
......
......@@ -31,6 +31,7 @@
* @copyright CiviCRM LLC (c) 2004-2019
*/
class CRM_Campaign_BAO_Petition extends CRM_Campaign_BAO_Survey {
/**
* Class constructor.
*/
......@@ -176,7 +177,8 @@ SELECT petition.id as id,
* @param array $params
* (reference ) an assoc array of name/value pairs.
*
* @return CRM_Campaign_BAO_Petition
* @return mixed
* CRM_Campaign_BAO_Petition or NULl or void
*/
public function createSignature(&$params) {
if (empty($params)) {
......@@ -355,7 +357,6 @@ AND tag_id = ( SELECT id FROM civicrm_tag WHERE name = %2 )";
return $statusTotal;
}
/**
* @param int $surveyId
*
......
......@@ -42,9 +42,9 @@ class CRM_Campaign_BAO_Query {
*
* @var array
*/
static $_campaignFields = NULL;
public static $_campaignFields = NULL;
static $_applySurveyClause = FALSE;
public static $_applySurveyClause = FALSE;
/**
* Function get the fields for campaign.
......@@ -444,12 +444,13 @@ INNER JOIN civicrm_custom_group grp on fld.custom_group_id = grp.id
* An array.
* @return $voterClause as a string
*/
/**
* @param array $params
*
* @return array
*/
static public function voterClause($params) {
public static function voterClause($params) {
$voterClause = [];
$fromClause = $whereClause = NULL;
if (!is_array($params) || empty($params)) {
......
......@@ -314,7 +314,7 @@ SELECT survey.id as id,
* @param string $returnColumn
* @param bool $includePetitionActivityType
*
* @return string
* @return mixed
*/
public static function getSurveyActivityType($returnColumn = 'label', $includePetitionActivityType = FALSE) {
static $activityTypes;
......
......@@ -160,7 +160,6 @@ class CRM_Campaign_Form_Petition extends CRM_Core_Form {
return $defaults;
}
public function buildQuickForm() {
if ($this->_action & CRM_Core_Action::DELETE) {
......@@ -300,7 +299,6 @@ WHERE $whereClause
return empty($errors) ? TRUE : $errors;
}
public function postProcess() {
// store the submitted values in an array
$params = $this->controller->exportValues($this->_name);
......
......@@ -59,6 +59,7 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form_Search {
/**
* Prefix for the controller.
* @var string
*/
protected $_prefix = "survey_";
......
......@@ -50,7 +50,6 @@ class CRM_Campaign_Form_Survey_Delete extends CRM_Core_Form {
*/
protected $_surveyTitle;
/**
* Set variables up before form is built.
*/
......
......@@ -36,11 +36,14 @@
*/
class CRM_Campaign_Form_Survey_Main extends CRM_Campaign_Form_Survey {
/* values
/**
* values
*
* @var array
*
*/
public $_values;
/**
......
......@@ -96,7 +96,6 @@ class CRM_Campaign_Form_Survey_Questions extends CRM_Campaign_Form_Survey {
parent::buildQuickForm();
}
/**
* Process the form.
*/
......
......@@ -40,10 +40,13 @@ class CRM_Campaign_Form_Survey_Results extends CRM_Campaign_Form_Survey {
protected $_reportTitle;
/* values
/**
* values
*
* @var array
*
*/
public $_values;
const NUM_OPTION = 11;
......
......@@ -45,6 +45,7 @@ class CRM_Campaign_Form_Task_Interview extends CRM_Campaign_Form_Task {
/**
* Variable to store redirect path
* @var string
*/
private $_userContext;
......
......@@ -36,6 +36,7 @@
class CRM_Campaign_Info extends CRM_Core_Component_Info {
/**
* @var string
* @inheritDoc
*/
protected $keyword = 'campaign';
......@@ -54,7 +55,6 @@ class CRM_Campaign_Info extends CRM_Core_Component_Info {
];
}
/**
* @inheritDoc
* @param bool $getAllUnconditionally
......@@ -103,7 +103,6 @@ class CRM_Campaign_Info extends CRM_Core_Component_Info {
return $permissions;
}
/**
* @inheritDoc
* @return null
......
......@@ -35,6 +35,7 @@
* Page for displaying Petition Signatures.
*/
class CRM_Campaign_Page_Petition extends CRM_Core_Page {
public function browse() {
//get the survey id
......
......@@ -31,6 +31,7 @@
* @copyright CiviCRM LLC (c) 2004-2019
*/
class CRM_Campaign_Page_Petition_Confirm extends CRM_Core_Page {
/**
* @return string
* @throws Exception
......
......@@ -31,6 +31,7 @@
* @copyright CiviCRM LLC (c) 2004-2019
*/
class CRM_Campaign_Page_Petition_ThankYou extends CRM_Core_Page {
/**
* Run page.
*
......
......@@ -43,7 +43,7 @@ class CRM_Campaign_Page_SurveyType extends CRM_Core_Page_Basic {
*
* @var array
*/
static $_links = NULL;
public static $_links = NULL;
/**
* The option group name.
......
......@@ -57,6 +57,7 @@ class CRM_Campaign_PseudoConstant extends CRM_Core_PseudoConstant {
/**
* Engagement Level
* @var int
*/
private static $engagementLevel;
......
......@@ -41,20 +41,20 @@ class CRM_Campaign_Selector_Search extends CRM_Core_Selector_Base implements CRM
*
* @var array
*/
static $_links = NULL;
public static $_links = NULL;
/**
* We use desc to remind us what that column is, name is used in the tpl
*
* @var array
*/
static $_columnHeaders;
public static $_columnHeaders;
/**
* Properties of contact we're interested in displaying
* @var array
*/
static $_properties = [
public static $_properties = [
'contact_id',
'sort_name',
'street_unit',
......@@ -178,7 +178,7 @@ class CRM_Campaign_Selector_Search extends CRM_Core_Selector_Base implements CRM
*
* @return array
*/
static public function &links() {
public static function &links() {
return self::$_links = [];
}
......
......@@ -38,13 +38,18 @@
*/
class CRM_Campaign_Task extends CRM_Core_Task {
/**
* Campaign tasks
*/
const
// Campaign tasks
INTERVIEW = 601,
RESERVE = 602,
RELEASE = 603;
static $objectType = 'campaign';
/**
* @var string
*/
public static $objectType = 'campaign';
/**
* These tasks are the core set of tasks that the user can perform
......
......@@ -41,7 +41,7 @@ class CRM_Case_BAO_Case extends CRM_Case_DAO_Case {
*
* @var array
*/
static $_exportableFields = NULL;
public static $_exportableFields = NULL;
/**
* Class constructor.
......@@ -416,6 +416,7 @@ WHERE cc.contact_id = %1 AND civicrm_case_type.name = '{$caseType}'";
* @param int $userID
* @param string $condition
* @param string $limit
* @param string $order
*
* @return string
*/
......
......@@ -41,7 +41,7 @@ class CRM_Case_BAO_CaseType extends CRM_Case_DAO_CaseType {
*
* @var array
*/
static $_exportableFields = NULL;
public static $_exportableFields = NULL;
/**
* Takes an associative array and creates a Case Type object.
......@@ -102,7 +102,6 @@ class CRM_Case_BAO_CaseType extends CRM_Case_DAO_CaseType {
}
}
/**
* Format / convert submitted array to xml for case type definition
*
......
......@@ -35,6 +35,7 @@
* This class generates form components for LinkCase Activity.
*/
class CRM_Case_Form_Activity_LinkCases {
/**
* @param CRM_Core_Form $form
*
......
......@@ -45,41 +45,49 @@ class CRM_Case_Form_Case extends CRM_Core_Form {
/**
* Case Id
* @var int
*/
public $_caseId = NULL;
/**
* Client Id
* @var int
*/
public $_currentlyViewedContactId = NULL;
/**
* Activity Type File
* @var int
*/
public $_activityTypeFile = NULL;
/**
* Logged in contact Id
* @var int
*/
public $_currentUserId = NULL;
/**
* Activity type Id
* @var int
*/
public $_activityTypeId = NULL;
/**
* Activity type Id
* @var int
*/
public $_activityId = NULL;
/**
* Action
* @var int
*/
public $_action;
/**
* Case type id
* @var int
*/
public $_caseTypeId = NULL;
......
......@@ -91,7 +91,6 @@ class CRM_Case_Form_EditClient extends CRM_Core_Form {
$this->preventAjaxSubmit();
}
public function addRules() {
$this->addFormRule([get_class($this), 'formRule'], $this);
}
......
......@@ -38,16 +38,19 @@ class CRM_Case_Form_Report extends CRM_Core_Form {
/**
* Case Id
* @var int
*/
public $_caseID = NULL;
/**
* Client Id
* @var int
*/
public $_clientID = NULL;
/**
* Activity set name
* @var string
*/
public $_activitySetName = NULL;
......@@ -98,17 +101,16 @@ class CRM_Case_Form_Report extends CRM_Core_Form {
);
$this->addButtons([
[
'type' => 'refresh',
'name' => ts('Generate Report'),
'isDefault' => TRUE,
],
[
'type' => 'cancel',
'name' => ts('Cancel'),
],
]
);
[
'type' => 'refresh',
'name' => ts('Generate Report'),
'isDefault' => TRUE,
],
[
'type' => 'cancel',
'name' => ts('Cancel'),
],
]);
// We want this form to redirect to a full page
$this->preventAjaxSubmit();
}
......
......@@ -59,6 +59,7 @@ class CRM_Case_Form_Search extends CRM_Core_Form_Search {
/**
* Prefix for the controller
* @var sting
*/
protected $_prefix = 'case_';
......@@ -298,6 +299,8 @@ class CRM_Case_Form_Search extends CRM_Core_Form_Search {
*
* @param array $fields
* Posted values of the form.
* @param array $files
* @param object $form
*
* @return array|bool
*/
......
......@@ -35,10 +35,16 @@
*/
class CRM_Case_Form_Task extends CRM_Core_Form_Task {
// Must be set to entity table name (eg. civicrm_participant) by child class
static $tableName = 'civicrm_case';
// Must be set to entity shortname (eg. event)
static $entityShortname = 'case';
/**
* Must be set to entity table name (eg. civicrm_participant) by child class
* @var string
*/
public static $tableName = 'civicrm_case';
/**
* Must be set to entity shortname (eg. event)
* @var string
*/
public static $entityShortname = 'case';
/**
* @inheritDoc
......
......@@ -35,10 +35,16 @@
*/
class CRM_Case_Form_Task_Batch extends CRM_Core_Form_Task_Batch {
// Must be set to entity table name (eg. civicrm_participant) by child class
static $tableName = 'civicrm_case';
// Must be set to entity shortname (eg. event)
static $entityShortname = 'case';
/**
* Must be set to entity table name (eg. civicrm_participant) by child class
* @var string
*/
public static $tableName = 'civicrm_case';
/**
* Must be set to entity shortname (eg. event)
* @var string
*/
public static $entityShortname = 'case';
/**
* Process the form after the input has been submitted and validated.
......
......@@ -40,13 +40,13 @@ class CRM_Case_Form_Task_PickProfile extends CRM_Core_Form_Task_PickProfile {
*
* @var string
*/
static $tableName = 'civicrm_case';
public static $tableName = 'civicrm_case';
/**
* Must be set to entity shortname (eg. event)
*
* @var string
*/
static $entityShortname = 'case';
public static $entityShortname = 'case';
}
......@@ -74,18 +74,17 @@ class CRM_Case_Form_Task_Print extends CRM_Case_Form_Task {
// just need to add a javacript to popup the window for printing
//
$this->addButtons([
[
'type' => 'next',
'name' => ts('Print Case List'),
'js' => ['onclick' => 'window.print()'],
'isDefault' => TRUE,
],
[
'type' => 'back',
'name' => ts('Done'),
],
]
);
[
'type' => 'next',
'name' => ts('Print Case List'),
'js' => ['onclick' => 'window.print()'],
'isDefault' => TRUE,
],
[
'type' => 'back',
'name' => ts('Done'),
],
]);
}
/**
......
......@@ -47,13 +47,12 @@ class CRM_Case_Form_Task_Result extends CRM_Case_Form_Task {
*/
public function buildQuickForm() {
$this->addButtons([
[
'type' => 'done',
'name' => ts('Done'),
'isDefault' => TRUE,
],
]
);
[
'type' => 'done',
'name' => ts('Done'),
'isDefault' => TRUE,
],
]);
}
}
......@@ -73,13 +73,12 @@ WHERE cs.id IN ( {$caseIDs} )";
*/
public function buildQuickForm() {
$this->addButtons([
[
'type' => 'done',
'name' => ts('Done'),
'isDefault' => TRUE,
],
]
);
[
'type' => 'done',
'name' => ts('Done'),
'isDefault' => TRUE,
],
]);
}
}
......@@ -37,6 +37,7 @@ class CRM_Case_Info extends CRM_Core_Component_Info {
/**
* @var string
* @inheritDoc
*/
protected $keyword = 'case';
......
......@@ -106,8 +106,8 @@ class CRM_Case_Page_AJAX {
$case = civicrm_api3('Case', 'getsingle', [
'id' => $caseId,
'check_permissions' => TRUE,
'return' => ['subject', 'case_type_id', 'status_id', 'start_date', 'end_date']]
);
'return' => ['subject', 'case_type_id', 'status_id', 'start_date', 'end_date'],
]);
$caseStatuses = CRM_Case_PseudoConstant::caseStatus();
$caseTypes = CRM_Case_PseudoConstant::caseType('title', FALSE);
......
......@@ -41,7 +41,7 @@ class CRM_Case_Page_Tab extends CRM_Core_Page {
*
* @var array
*/
static $_links = NULL;
public static $_links = NULL;
public $_permission = NULL;
public $_contactId = NULL;
......@@ -216,7 +216,7 @@ class CRM_Case_Page_Tab extends CRM_Core_Page {
* @return array
* (reference) of action links
*/
static public function &links() {
public static function &links() {
$config = CRM_Core_Config::singleton();
if (!(self::$_links)) {
......
......@@ -40,7 +40,7 @@ class CRM_Case_PseudoConstant extends CRM_Core_PseudoConstant {
* Activity type
* @var array
*/
static $activityTypeList = [];
public static $activityTypeList = [];
/**
* Get all the case statues.
......
......@@ -41,20 +41,20 @@ class CRM_Case_Selector_Search extends CRM_Core_Selector_Base {
*
* @var array
*/
static $_links = NULL;
public static $_links = NULL;
/**
* We use desc to remind us what that column is, name is used in the tpl
*
* @var array
*/
static $_columnHeaders;
public static $_columnHeaders;
/**
* Properties of contact we're interested in displaying
* @var array
*/
static $_properties = [
public static $_properties = [
'contact_id',
'contact_type',
'sort_name',
......@@ -180,7 +180,7 @@ class CRM_Case_Selector_Search extends CRM_Core_Selector_Base {
*
* @return array
*/
static public function &links($isDeleted = FALSE, $key = NULL) {
public static function &links($isDeleted = FALSE, $key = NULL) {
$extraParams = ($key) ? "&key={$key}" : NULL;
if ($isDeleted) {
......
......@@ -38,11 +38,15 @@
*/
class CRM_Case_Task extends CRM_Core_Task {
const
// Case tasks
RESTORE_CASES = 501;
/**
* Case tasks
*/
const RESTORE_CASES = 501;
static $objectType = 'case';
/**
* @var string
*/
public static $objectType = 'case';
/**
* These tasks are the core set of tasks that the user can perform
......
......@@ -619,7 +619,7 @@ AND a.is_deleted = 0
$defaultAssigneeOptions = civicrm_api3('OptionValue', 'get', [
'option_group_id' => 'activity_default_assignee',
'options' => [ 'limit' => 0 ]
'options' => ['limit' => 0],
]);
foreach ($defaultAssigneeOptions['values'] as $option) {
......@@ -686,7 +686,7 @@ AND a.is_deleted = 0
protected function isBidirectionalRelationshipType($relationshipTypeId) {
$relationshipTypeResult = civicrm_api3('RelationshipType', 'get', [
'id' => $relationshipTypeId,
'options' => ['limit' => 1]
'options' => ['limit' => 1],
]);
if ($relationshipTypeResult['count'] === 0) {
......@@ -712,7 +712,7 @@ AND a.is_deleted = 0
}
$contact = civicrm_api3('Contact', 'get', [
'id' => $activityTypeXML->default_assignee_contact
'id' => $activityTypeXML->default_assignee_contact,
]);
if ($contact['count'] == 1) {
......
......@@ -65,9 +65,9 @@ class CRM_Case_XMLProcessor_Report extends CRM_Case_XMLProcessor {
public function getRedactionRules() {
foreach (array(
'redactionStringRules',
'redactionRegexRules',
) as $key => $rule) {
'redactionStringRules',
'redactionRegexRules',
) as $key => $rule) {
$$rule = CRM_Case_PseudoConstant::redactionRule($key);
if (!empty($$rule)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment