From 5c9ff0550bbcd94725c88911fbf842144fb0a326 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 15 Jan 2015 19:58:23 +1300 Subject: [PATCH] minor tidies --- CRM/Activity/BAO/Activity.php | 4 ++-- CRM/Admin/Form/Setting.php | 12 ++++++++---- CRM/Campaign/Form/Gotv.php | 5 +---- CRM/Contact/BAO/Contact.php | 17 ++++++++++++----- CRM/Contact/Form/RelatedContact.php | 7 +++---- CRM/Contact/Form/Task.php | 6 ++---- CRM/Contact/Selector/Custom.php | 8 +++++--- CRM/Core/Controller/Simple.php | 4 +++- CRM/Core/QuickForm/Action/Upload.php | 4 +++- .../BAO/QueryBuilder/IndividualSupervised.php | 4 +--- CRM/Event/Form/Task/Email.php | 2 +- CRM/SMS/Form/Provider.php | 2 +- 12 files changed, 42 insertions(+), 33 deletions(-) diff --git a/CRM/Activity/BAO/Activity.php b/CRM/Activity/BAO/Activity.php index 0c65ba6c76..4e39db2618 100644 --- a/CRM/Activity/BAO/Activity.php +++ b/CRM/Activity/BAO/Activity.php @@ -1494,7 +1494,7 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND } /** - * Send the sms message to a specific contact + * Send the sms message to a specific contact. * * @param int $toID * The contact id of the recipient. @@ -1568,7 +1568,7 @@ LEFT JOIN civicrm_activity_contact src ON (src.activity_id = ac.activity_id AND } /** - * Send the message to a specific contact + * Send the message to a specific contact. * * @param string $from * The name and email of the sender. diff --git a/CRM/Admin/Form/Setting.php b/CRM/Admin/Form/Setting.php index 6ab1d92e46..094d00ae6d 100644 --- a/CRM/Admin/Form/Setting.php +++ b/CRM/Admin/Form/Setting.php @@ -85,11 +85,11 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form { //Set defaults for autocomplete and contact reference options $this->_defaults['autocompleteContactSearch'] = array( - '1' => 1, - ) + $autoSearchFields; + '1' => 1, + ) + $autoSearchFields; $this->_defaults['autocompleteContactReference'] = array( - '1' => 1, - ) + $cRSearchFields; + '1' => 1, + ) + $cRSearchFields; // we can handle all the ones defined in the metadata here. Others to be converted foreach ($this->_settings as $setting => $group) { @@ -173,6 +173,10 @@ class CRM_Admin_Form_Setting extends CRM_Core_Form { } /** + * Common Process. + * + * @todo Document what I do. + * * @param array $params */ public function commonProcess(&$params) { diff --git a/CRM/Campaign/Form/Gotv.php b/CRM/Campaign/Form/Gotv.php index e1c563cbde..169f0b48d0 100755 --- a/CRM/Campaign/Form/Gotv.php +++ b/CRM/Campaign/Form/Gotv.php @@ -93,10 +93,7 @@ class CRM_Campaign_Form_Gotv extends CRM_Core_Form { } /** - * Build the form object - * - * - * @return void + * Build the form object. */ public function buildQuickForm() { if ($this->_search) { diff --git a/CRM/Contact/BAO/Contact.php b/CRM/Contact/BAO/Contact.php index d49f64cd7e..bdd35b0cd1 100644 --- a/CRM/Contact/BAO/Contact.php +++ b/CRM/Contact/BAO/Contact.php @@ -536,6 +536,7 @@ WHERE civicrm_contact.id = " . CRM_Utils_Type::escape($id, 'Integer'); public function createDefaultCrudLink($crudLinkSpec) { switch ($crudLinkSpec['action']) { case CRM_Core_Action::VIEW: + return array( 'title' => $this->display_name, 'path' => 'civicrm/contact/view', @@ -1177,7 +1178,7 @@ WHERE id={$id}; "; * @return array * array of importable Fields */ - static function importableFields( + public static function importableFields( $contactType = 'Individual', $status = FALSE, $showAll = FALSE, @@ -1401,8 +1402,14 @@ WHERE id={$id}; "; if (!$fields) { $fields = CRM_Contact_DAO_Contact::export(); - // the fields are meant for contact types - if (in_array($contactType, array('Individual', 'Household', 'Organization', 'All'))) { + // The fields are meant for contact types. + if (in_array($contactType, array( + 'Individual', + 'Household', + 'Organization', + 'All', + ) + )) { $fields = array_merge($fields, CRM_Core_OptionValue::getFields('', $contactType)); } // add current employer for individuals @@ -1615,8 +1622,8 @@ WHERE id={$id}; "; $returnProperties = self::makeHierReturnProperties($fields, $contactId); - // We don't know the contents of return properties, but we need the lower level ids of the contact - // so add a few fields. + // We don't know the contents of return properties, but we need the lower + // level ids of the contact so add a few fields. $returnProperties['first_name'] = $returnProperties['organization_name'] = $returnProperties['household_name'] = diff --git a/CRM/Contact/Form/RelatedContact.php b/CRM/Contact/Form/RelatedContact.php index 3ba4ceee78..33c301d0b6 100644 --- a/CRM/Contact/Form/RelatedContact.php +++ b/CRM/Contact/Form/RelatedContact.php @@ -99,11 +99,10 @@ class CRM_Contact_Form_RelatedContact extends CRM_Core_Form { } /** - * Set default values for the form. Note that in edit/view mode - * the default values are retrieved from the database + * Set default values for the form. * - * - * @return void + * Note that in edit/view mode the default values are retrieved from the + * database */ public function setDefaultValues() { return $this->_defaults; diff --git a/CRM/Contact/Form/Task.php b/CRM/Contact/Form/Task.php index 7bce1b4c08..a8070022e3 100644 --- a/CRM/Contact/Form/Task.php +++ b/CRM/Contact/Form/Task.php @@ -340,7 +340,7 @@ class CRM_Contact_Form_Task extends CRM_Core_Form { } /** - * Build the form object + * Build the form object. */ public function buildQuickForm() { $this->addDefaultButtons(ts('Confirm Action')); @@ -381,10 +381,8 @@ class CRM_Contact_Form_Task extends CRM_Core_Form { /** * Replace ids of household members in $this->_contactIds with the id of their household. - * CRM-8338 - * * - * @return void + * CRM-8338 */ public function mergeContactIdsByHousehold() { if (empty($this->_contactIds)) { diff --git a/CRM/Contact/Selector/Custom.php b/CRM/Contact/Selector/Custom.php index 54a0f1132a..4a6c9c85a5 100644 --- a/CRM/Contact/Selector/Custom.php +++ b/CRM/Contact/Selector/Custom.php @@ -98,7 +98,7 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { protected $_customSearchClass; /** - * Class constructor + * Class constructor. * * @param $customSearchClass * @param array $formValues @@ -372,8 +372,6 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { /** * Given the current formValues, gets the query in local language. * - * @param array $formValues submitted formValues - * * @return array * which contains an array of strings */ @@ -382,6 +380,8 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { } /** + * Get summary. + * * @return mixed */ public function getSummary() { @@ -402,6 +402,8 @@ class CRM_Contact_Selector_Custom extends CRM_Contact_Selector { } /** + * Do nothing. + * * @return null */ public function alphabetQuery() { diff --git a/CRM/Core/Controller/Simple.php b/CRM/Core/Controller/Simple.php index f27d31c05c..40c489d1fa 100644 --- a/CRM/Core/Controller/Simple.php +++ b/CRM/Core/Controller/Simple.php @@ -116,7 +116,9 @@ class CRM_Core_Controller_Simple extends CRM_Core_Controller { } /** - * @return mixed + * Get template file name. + * + * @return string */ public function getTemplateFileName() { // there is only one form here, so should be quite easy diff --git a/CRM/Core/QuickForm/Action/Upload.php b/CRM/Core/QuickForm/Action/Upload.php index e36492ab31..9179f6d025 100644 --- a/CRM/Core/QuickForm/Action/Upload.php +++ b/CRM/Core/QuickForm/Action/Upload.php @@ -47,7 +47,7 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action { protected $_uploadDir; /** - * Class constructor + * Class constructor. * * @param object $stateMachine * Reference to state machine object. @@ -134,6 +134,8 @@ class CRM_Core_QuickForm_Action_Upload extends CRM_Core_QuickForm_Action { } /** + * Real perform. + * * @todo document what I do. * * @param CRM_Core_Form $page diff --git a/CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php b/CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php index fe878ad5b4..67ec55e4a3 100644 --- a/CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php +++ b/CRM/Dedupe/BAO/QueryBuilder/IndividualSupervised.php @@ -66,9 +66,7 @@ class CRM_Dedupe_BAO_QueryBuilder_IndividualSupervised extends CRM_Dedupe_BAO_Qu WHERE contact1.contact_type = 'Individual' AND " . self::internalFilters($rg); return array( - "civicrm_contact.{$rg->name}.{$rg->threshold}" => $query + "civicrm_contact.{$rg->name}.{$rg->threshold}" => $query, ); } } - -; diff --git a/CRM/Event/Form/Task/Email.php b/CRM/Event/Form/Task/Email.php index d2ab1df047..c95b221868 100644 --- a/CRM/Event/Form/Task/Email.php +++ b/CRM/Event/Form/Task/Email.php @@ -62,7 +62,7 @@ class CRM_Event_Form_Task_Email extends CRM_Event_Form_Task { public $_templates = NULL; /** - * Build all the data structures needed to build the form + * Build all the data structures needed to build the form. */ public function preProcess() { CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this); diff --git a/CRM/SMS/Form/Provider.php b/CRM/SMS/Form/Provider.php index 91a15f1949..59ed8bdf02 100644 --- a/CRM/SMS/Form/Provider.php +++ b/CRM/SMS/Form/Provider.php @@ -96,7 +96,7 @@ class CRM_SMS_Form_Provider extends CRM_Core_Form { $this->addRule('title', ts('This Title already exists in Database.'), 'objectExists', array( 'CRM_SMS_DAO_Provider', - $this->_id + $this->_id, )); $this->add('text', 'username', ts('Username'), -- 2.25.1