From 2fb1dd66566a97046b19d9203155fd19d2f12be0 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 27 Jan 2015 12:03:42 +1300 Subject: [PATCH] minor tidyups --- CRM/Logging/ReportSummary.php | 18 +++++++++++++----- CRM/Report/Form/Contact/LoggingSummary.php | 17 +++++++++++++---- api/v3/Acl.php | 1 - api/v3/Case.php | 11 +++++------ api/v3/Generic/Getlist.php | 3 ++- api/v3/Generic/Setvalue.php | 10 ++++++++-- api/v3/Phone/Get.php | 3 ++- api/v3/Tag.php | 13 +++++++------ 8 files changed, 50 insertions(+), 26 deletions(-) diff --git a/CRM/Logging/ReportSummary.php b/CRM/Logging/ReportSummary.php index 25f5d97ce9..e345b0befa 100644 --- a/CRM/Logging/ReportSummary.php +++ b/CRM/Logging/ReportSummary.php @@ -30,7 +30,6 @@ * @package CRM * @copyright CiviCRM LLC (c) 2004-2014 * $Id$ - * */ class CRM_Logging_ReportSummary extends CRM_Report_Form { protected $cid; @@ -40,6 +39,7 @@ class CRM_Logging_ReportSummary extends CRM_Report_Form { protected $loggingDB; /** + * Class constructor. */ public function __construct() { // don’t display the ‘Add these Contacts to Group’ button @@ -187,16 +187,18 @@ class CRM_Logging_ReportSummary extends CRM_Report_Form { $customTables = $logging->entityCustomDataLogTables('Address'); foreach ($customTables as $table) { $this->_logTables[$table] = array( - 'fk' => 'contact_id', // for join of fk_table with contact table + // For join of fk_table with contact table. + 'fk' => 'contact_id', 'joins' => array( - 'table' => 'log_civicrm_address', // fk_table + // fk_table + 'table' => 'log_civicrm_address', 'join' => 'entity_log_civireport.entity_id = fk_table.id', ), 'log_type' => 'Contact', ); } - // allow log tables to be extended via report hooks + // Allow log tables to be extended via report hooks. CRM_Report_BAO_Hook::singleton()->alterLogTables($this, $this->_logTables); parent::__construct(); @@ -345,7 +347,9 @@ ORDER BY log_civicrm_entity_log_date DESC {$this->_limit}"; } /** - * @param $entity + * Get log type. + * + * @param string $entity * * @return string */ @@ -358,6 +362,8 @@ ORDER BY log_civicrm_entity_log_date DESC {$this->_limit}"; } /** + * Get entity value. + * * @param int $id * @param $entity * @param $logDate @@ -408,6 +414,8 @@ WHERE log_date <= %1 AND id = %2 ORDER BY log_date DESC LIMIT 1"; } /** + * Get entity action. + * * @param int $id * @param int $connId * @param $entity diff --git a/CRM/Report/Form/Contact/LoggingSummary.php b/CRM/Report/Form/Contact/LoggingSummary.php index 16fd62ac21..c3b62f9786 100644 --- a/CRM/Report/Form/Contact/LoggingSummary.php +++ b/CRM/Report/Form/Contact/LoggingSummary.php @@ -30,10 +30,10 @@ * @package CRM * @copyright CiviCRM LLC (c) 2004-2014 * $Id$ - * */ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { /** + * Class constructor. */ public function __construct() { parent::__construct(); @@ -125,7 +125,11 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { ), 'log_action' => array( 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'options' => array('Insert' => ts('Insert'), 'Update' => ts('Update'), 'Delete' => ts('Delete')), + 'options' => array( + 'Insert' => ts('Insert'), + 'Update' => ts('Update'), + 'Delete' => ts('Delete'), + ), 'title' => ts('Action'), 'type' => CRM_Utils_Type::T_STRING, ), @@ -157,7 +161,10 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { } /** - * @param $rows + * Alter Report Display. + * + * @param array $rows + * Rows from report query. */ public function alterDisplay(&$rows) { // cache for id → is_deleted mapping @@ -236,7 +243,9 @@ class CRM_Report_Form_Contact_LoggingSummary extends CRM_Logging_ReportSummary { } /** - * @param null $logTable + * Generate From Clause. + * + * @param string $logTable */ public function from($logTable = NULL) { static $entity = NULL; diff --git a/api/v3/Acl.php b/api/v3/Acl.php index 9b681f8db2..9bc52f32fb 100644 --- a/api/v3/Acl.php +++ b/api/v3/Acl.php @@ -30,7 +30,6 @@ * * @package CiviCRM_APIv3 * @subpackage API_acl - * */ /** diff --git a/api/v3/Case.php b/api/v3/Case.php index 63ac673ef7..870e8dc525 100644 --- a/api/v3/Case.php +++ b/api/v3/Case.php @@ -32,12 +32,11 @@ * @package CiviCRM_APIv3 * @subpackage API_Case * @copyright CiviCRM LLC (c) 2004-2014 - * */ /** - * Open a new case, add client and manager roles, and add standard timeline + * Open a new case, add client and manager roles, and add standard timeline. * * @param array $params * //REQUIRED: @@ -125,10 +124,10 @@ function civicrm_api3_case_create($params) { } /** - * Adjust Metadata for Get Action + * Adjust Metadata for Get Action. * * @param array $params - * Array or parameters determined by getfields. + * Parameters determined by getfields. */ function _civicrm_api3_case_get_spec(&$params) { $params['contact_id']['api.aliases'] = array('client_id'); @@ -136,7 +135,7 @@ function _civicrm_api3_case_get_spec(&$params) { } /** - * Adjust Metadata for Create Action + * Adjust Metadata for Create Action. * * @param array $params * Array or parameters determined by getfields. @@ -158,7 +157,7 @@ function _civicrm_api3_case_create_spec(&$params) { } /** - * Adjust Metadata for Update action + * Adjust Metadata for Update action. * * @param array $params * Array or parameters determined by getfields. diff --git a/api/v3/Generic/Getlist.php b/api/v3/Generic/Getlist.php index 8676ee6e98..86b8a653cd 100644 --- a/api/v3/Generic/Getlist.php +++ b/api/v3/Generic/Getlist.php @@ -25,9 +25,10 @@ +--------------------------------------------------------------------+ */ /** - * Generic api wrapper used for quicksearch and autocomplete + * Generic api wrapper used for quicksearch and autocomplete. * * @param array $apiRequest + * * @return mixed */ function civicrm_api3_generic_getList($apiRequest) { diff --git a/api/v3/Generic/Setvalue.php b/api/v3/Generic/Setvalue.php index 7edb1785f6..2da98756fc 100644 --- a/api/v3/Generic/Setvalue.php +++ b/api/v3/Generic/Setvalue.php @@ -1,6 +1,9 @@ 'NaN', 'field' => "id")); + return civicrm_api3_create_error(ts('Please enter a number'), array( + 'error_code' => 'NaN', + 'field' => "id", + )); } $field = CRM_Utils_String::munge($params['field']); diff --git a/api/v3/Phone/Get.php b/api/v3/Phone/Get.php index 403aa6bbe7..8edc255b98 100644 --- a/api/v3/Phone/Get.php +++ b/api/v3/Phone/Get.php @@ -1,7 +1,8 @@