Commit 62d3ee27 authored by Seamus Lee's avatar Seamus Lee

(NFC) Update CRM/Activity CRM/Admin and CRM/Batch folders to be the future coder standard

parent b18ac85d
......@@ -49,14 +49,14 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
*
* @var array
*/
static $_exportableFields = NULL;
public static $_exportableFields = NULL;
/**
* Static field for all the activity information that we can potentially import.
*
* @var array
*/
static $_importableFields = NULL;
public static $_importableFields = NULL;
/**
* Check if there is absolute minimum of data to add the object.
......@@ -901,7 +901,7 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
* that this concept might be extended later. In practice most places that
* call this then re-add CiviCase in some way so it's all a bit... odd.
*
* @return array Array of component id and name.
* @return array
* Array of component id and name.
*/
public static function activityComponents($excludeComponentHandledActivities = TRUE) {
......
......@@ -147,9 +147,9 @@ AND civicrm_contact.is_deleted = 0
* @see DB_DataObject::getLink()
*
* @return array|null
* array = if there are links defined for this table.
* empty array - if there is a links.ini file, but no links on this table
* null - if no links.ini exists for this database (hence try auto_links).
* array if there are links defined for this table.
* empty array - if there is a links.ini file, but no links on this table
* null - if no links.ini exists for this database (hence try auto_links).
*/
public function links() {
$link = ['activity_id' => 'civicrm_activity:id'];
......
......@@ -673,6 +673,7 @@ class CRM_Activity_BAO_Query {
* Where/qill clause for notes
*
* @param array $values
* @param object $query
*/
public static function whereClauseSingleActivityText(&$values, &$query) {
list($name, $op, $value, $grouping, $wildcard) = $values;
......
......@@ -119,7 +119,8 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
protected $unsavedWarn = TRUE;
/*
/**
*
* Is it possible to create separate activities with this form?
*
* When TRUE, the form will ask whether the user wants to create separate
......@@ -133,7 +134,9 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
* behavior (e.g. in CRM_Case_Form_Activity)
*
* @var boolean
*
*/
protected $supportsActivitySeparation = TRUE;
/**
......@@ -826,7 +829,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
$doNotNotifyAssigneeFor = (array) Civi::settings()
->get('do_not_notify_assignees_for');
if (($this->_activityTypeId && in_array($this->_activityTypeId, $doNotNotifyAssigneeFor)) || !Civi::settings()
->get('activity_assignee_notification')) {
->get('activity_assignee_notification')) {
$this->assign('activityAssigneeNotification', FALSE);
}
else {
......
......@@ -35,6 +35,7 @@
* This class generates form components for Activity Filter.
*/
class CRM_Activity_Form_ActivityFilter extends CRM_Core_Form {
public function buildQuickForm() {
// add activity search filter
$activityOptions = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE);
......
......@@ -35,6 +35,7 @@
* This class generates form components for Activity Links.
*/
class CRM_Activity_Form_ActivityLinks extends CRM_Core_Form {
public function buildQuickForm() {
self::commonBuildQuickForm($this);
}
......
......@@ -59,6 +59,7 @@ class CRM_Activity_Form_Search extends CRM_Core_Form_Search {
/**
* Prefix for the controller.
* @var string
*/
protected $_prefix = "activity_";
......
......@@ -45,11 +45,13 @@ class CRM_Activity_Form_Task_Batch extends CRM_Activity_Form_Task {
/**
* Maximum profile fields that will be displayed.
* @var int
*/
protected $_maxFields = 9;
/**
* Variable to store redirect path.
* @var string
*/
protected $_userContext;
......
......@@ -45,11 +45,13 @@ class CRM_Activity_Form_Task_FileOnCase extends CRM_Activity_Form_Task {
/**
* Variable to store redirect path.
* @var string
*/
protected $_userContext;
/**
* Variable to store contact Ids.
* @var array
*/
public $_contacts;
......
......@@ -45,16 +45,19 @@ class CRM_Activity_Form_Task_PickOption extends CRM_Activity_Form_Task {
/**
* Maximum Activities that should be allowed to update.
* @var int
*/
protected $_maxActivities = 100;
/**
* Variable to store redirect path.
* @var int
*/
protected $_userContext;
/**
* Variable to store contact Ids.
* @var array
*/
public $_contacts;
......
......@@ -45,11 +45,13 @@ class CRM_Activity_Form_Task_PickProfile extends CRM_Activity_Form_Task {
/**
* Maximum Activities that should be allowed to update.
* @var int
*/
protected $_maxActivities = 100;
/**
* Variable to store redirect path.
* @var string
*/
protected $_userContext;
......
......@@ -40,6 +40,7 @@ class CRM_Activity_Import_Field {
/**
* Title of the field to be used in display
* @var string
*/
public $_title;
......
......@@ -36,7 +36,6 @@
*/
class CRM_Activity_Import_Form_MapField extends CRM_Import_Form_MapField {
/**
* Set variables up before form is built.
*/
......
......@@ -36,16 +36,19 @@ abstract class CRM_Activity_Import_Parser extends CRM_Import_Parser {
/**
* Imported file size.
* @var int
*/
protected $_fileSize;
/**
* Separator being used.
* @var string
*/
protected $_seperator;
/**
* Total number of lines in file.
* @var int
*/
protected $_lineCount;
......@@ -63,6 +66,8 @@ abstract class CRM_Activity_Import_Parser extends CRM_Import_Parser {
* @param bool $skipColumnHeader
* @param int $mode
* @param int $onDuplicate
* @param int $statusID
* @param int $totalRowCount
*
* @return mixed
* @throws Exception
......
......@@ -47,7 +47,7 @@ class CRM_Activity_Import_Parser_Activity extends CRM_Activity_Import_Parser {
/**
* Array of successfully imported activity id's
*
* @array
* @var array
*/
protected $_newActivity;
......
......@@ -36,6 +36,7 @@
* This class contains all the function that are called using AJAX (jQuery)
*/
class CRM_Activity_Page_AJAX {
public static function getCaseActivity() {
// Should those params be passed through the validateParams method?
$caseID = CRM_Utils_Type::validate($_GET['caseID'], 'Integer');
......@@ -143,7 +144,6 @@ class CRM_Activity_Page_AJAX {
CRM_Utils_JSON::output($clientRelationshipsDT);
}
public static function getCaseRoles() {
$caseID = CRM_Utils_Type::escape($_GET['caseID'], 'Integer');
$contactID = CRM_Utils_Type::escape($_GET['cid'], 'Integer');
......
......@@ -41,7 +41,7 @@ class CRM_Activity_Selector_Activity extends CRM_Core_Selector_Base implements C
*
* @var array
*/
static $_columnHeaders;
public static $_columnHeaders;
/**
* ContactId - contact id of contact whose activies are displayed
......
......@@ -43,21 +43,21 @@ class CRM_Activity_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',
'contact_type',
'contact_sub_type',
......
......@@ -35,7 +35,7 @@
*/
class CRM_Activity_Task extends CRM_Core_Task {
static $objectType = 'activity';
public static $objectType = 'activity';
/**
* These tasks are the core set of tasks that the user can perform
......
......@@ -60,8 +60,7 @@ class CRM_Activity_Tokens extends \Civi\Token\AbstractTokenSubscriber {
*/
public function checkActive(\Civi\Token\TokenProcessor $processor) {
// Extracted from scheduled-reminders code. See the class description.
return
!empty($processor->context['actionMapping'])
return !empty($processor->context['actionMapping'])
&& $processor->context['actionMapping']->getEntity() === 'civicrm_activity';
}
......
......@@ -39,11 +39,13 @@ class CRM_Admin_Form_LabelFormats extends CRM_Admin_Form {
/**
* Label Format ID.
* @var int
*/
protected $_id = NULL;
/**
* Group name, label format or name badge
* @var string
*/
protected $_group = NULL;
......
......@@ -36,10 +36,16 @@
* used by membership, contributions, event registrations, etc.
*/
class CRM_Admin_Form_MessageTemplates extends CRM_Admin_Form {
// which (and whether) mailing workflow this template belongs to
/**
* which (and whether) mailing workflow this template belongs to
* @var int
*/
protected $_workflow_id = NULL;
// Is document file is already loaded as default value?
/**
* Is document file is already loaded as default value?
* @var bool
*/
protected $_is_document = FALSE;
public function preProcess() {
......
......@@ -38,6 +38,7 @@ class CRM_Admin_Form_Navigation extends CRM_Admin_Form {
/**
* The parent id of the navigation menu.
* @var int
*/
protected $_currentParentID = NULL;
......
......@@ -44,7 +44,8 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form {
protected $_paymentProcessorDAO;
/**
* @var int $_paymentProcessorType Payment processor Type ID
* @var int
* Payment processor Type ID
*/
protected $_paymentProcessorType;
......@@ -448,7 +449,7 @@ class CRM_Admin_Form_PaymentProcessor extends CRM_Admin_Form {
else {
$creditCards = "NULL";
}
$params = array_merge([
$params = array_merge([
'id' => $test ? $this->_testID : $this->_id,
'domain_id' => $domainID,
'is_test' => $test,
......
......@@ -39,6 +39,7 @@ class CRM_Admin_Form_PdfFormats extends CRM_Admin_Form {
/**
* PDF Page Format ID.
* @var int
*/
protected $_id = NULL;
......
......@@ -38,6 +38,7 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form {
/**
* Scheduled Reminder ID.
* @var int
*/
protected $_id = NULL;
......
......@@ -255,7 +255,6 @@ class CRM_Admin_Form_Setting_Localization extends CRM_Admin_Form_Setting {
}
}
/**
* Replace available currencies by the ones provided
*
......@@ -286,7 +285,6 @@ class CRM_Admin_Form_Setting_Localization extends CRM_Admin_Form_Setting {
}
/**
* @return array
*/
......
......@@ -119,6 +119,7 @@ trait CRM_Admin_Form_SettingTrait {
* e.g get 'serialize' key, if exists, for a field.
*
* @param $setting
* @param $item
* @return mixed
*/
protected function getSettingMetadataItem($setting, $item) {
......@@ -294,6 +295,7 @@ trait CRM_Admin_Form_SettingTrait {
];
return $mapping[$htmlType];
}
/**
* Get the defaults for all fields defined in the metadata.
*
......
......@@ -300,7 +300,7 @@ class CRM_Admin_Page_AJAX {
*
* This appears to be only used by scheduled reminders.
*/
static public function mappingList() {
public static function mappingList() {
if (empty($_GET['mappingID'])) {
CRM_Utils_JSON::output(['status' => 'error', 'error_msg' => 'required params missing.']);
}
......@@ -383,10 +383,10 @@ class CRM_Admin_Page_AJAX {
}
$dao = CRM_Utils_SQL_Select::from('civicrm_tag')
->where($whereClauses)
->groupBy('id')
->orderBy($orderColumn)
->execute();
->where($whereClauses)
->groupBy('id')
->orderBy($orderColumn)
->execute();
while ($dao->fetch()) {
if (!empty($substring)) {
......
......@@ -59,7 +59,6 @@ class CRM_Admin_Page_APIExplorer extends CRM_Core_Page {
return $paths;
}
/**
* Run page.
*
......
......@@ -37,6 +37,7 @@
* For initial version, this page only contains static links - so this class is empty for now.
*/
class CRM_Admin_Page_Access extends CRM_Core_Page {
/**
* @return string
*/
......
......@@ -35,6 +35,7 @@
* Page for displaying Administer CiviCRM Control Panel.
*/
class CRM_Admin_Page_Admin extends CRM_Core_Page {
/**
* Run page.
*
......
......@@ -245,6 +245,7 @@ class CRM_Admin_Page_CKEditorConfig extends CRM_Core_Page {
}
/**
* @param string $preset
* @param string $contents
*/
public static function saveConfigFile($preset, $contents) {
......
......@@ -35,6 +35,7 @@
* Page for displaying list of site configuration tasks with links to each setting form.
*/
class CRM_Admin_Page_ConfigTaskList extends CRM_Core_Page {
/**
* Run page.
*
......
......@@ -43,7 +43,7 @@ class CRM_Admin_Page_ContactType extends CRM_Core_Page_Basic {
*
* @var array
*/
static $_links = NULL;
public static $_links = NULL;
/**
* Get BAO Name.
......
......@@ -41,7 +41,7 @@ class CRM_Admin_Page_EventTemplate extends CRM_Core_Page_Basic {
*
* @var array
*/
static $_links = NULL;
public static $_links = NULL;
/**
* Get BAO Name.
......
......@@ -42,7 +42,7 @@ class CRM_Admin_Page_Extensions extends CRM_Core_Page_Basic {
*
* @var array
*/
static $_links = NULL;
public static $_links = NULL;
/**
* Obtains the group name from url and sets the title.
......
......@@ -41,7 +41,7 @@ class CRM_Admin_Page_Job extends CRM_Core_Page_Basic {
*
* @var array
*/
static $_links = NULL;
public static $_links = NULL;
/**
* Get BAO Name.
......
......@@ -41,7 +41,7 @@ class CRM_Admin_Page_JobLog extends CRM_Core_Page_Basic {
*
* @var array
*/
static $_links = NULL;
public static $_links = NULL;
/**
* Get BAO Name.
......
......@@ -44,7 +44,7 @@ class CRM_Admin_Page_LabelFormats extends CRM_Core_Page_Basic {
*
* @var array
*/
static $_links = NULL;
public static $_links = NULL;
/**
* Get BAO Name.
......
......@@ -43,7 +43,7 @@ class CRM_Admin_Page_LocationType extends CRM_Core_Page_Basic {
*
* @var array
*/
static $_links = NULL;
public static $_links = NULL;
/**
* Get BAO Name.
......
......@@ -43,7 +43,7 @@ class CRM_Admin_Page_MailSettings extends CRM_Core_Page_Basic {
*
* @var array
*/
static $_links = NULL;
public static $_links = NULL;
/**
* Get BAO Name.
......
......@@ -43,7 +43,7 @@ class CRM_Admin_Page_Mapping extends CRM_Core_Page_Basic {
*
* @var array
*/
static $_links = NULL;
public static $_links = NULL;
/**
* Get BAO.
......
......@@ -41,12 +41,18 @@ class CRM_Admin_Page_MessageTemplates extends CRM_Core_Page_Basic {
*
* @var array
*/
static $_links = NULL;
public static $_links = NULL;
// ids of templates which diverted from the default ones and can be reverted
/**
* ids of templates which diverted from the default ones and can be reverted
* @var array
*/
protected $_revertible = [];
// set to the id that we’re reverting at the given moment (if we are)
/**
* set to the id that we’re reverting at the given moment (if we are)
* @var int
*/
protected $_revertedId;
/**
......
......@@ -41,7 +41,7 @@ class CRM_Admin_Page_Navigation extends CRM_Core_Page_Basic {
*
* @var array
*/
static $_links = NULL;
public static $_links = NULL;
/**
* Get BAO Name.
......
......@@ -43,35 +43,35 @@ class CRM_Admin_Page_Options extends CRM_Core_Page_Basic {
*
* @var array
*/
static $_links = NULL;
public static $_links = NULL;
/**
* The option group name.
*
* @var array
*/
static $_gName = NULL;
public static $_gName = NULL;
/**
* The option group name in display format (capitalized, without underscores...etc)
*
* @var array
*/
static $_gLabel = NULL;
public static $_gLabel = NULL;
/**
* The option group id.
*
* @var array
*/
static $_gId = NULL;
public static $_gId = NULL;
/**
* A boolean determining if you can add options to this group in the GUI.
*
* @var boolean
*/
static $_isLocked = FALSE;
public static $_isLocked = FALSE;
/**
* Obtains the group name from url string or id from $_GET['gid'].
......
......@@ -41,7 +41,7 @@ class CRM_Admin_Page_PaymentProcessor extends CRM_Core_Page_Basic {
*
* @var array
*/
static $_links = NULL;
public static $_links = NULL;
/**
* Get BAO Name.
......
......@@ -41,7 +41,7 @@ class CRM_Admin_Page_PaymentProcessorType extends CRM_Core_Page_Basic {
*
* @var array
*/
static $_links = NULL;
public static $_links = NULL;
/**