From e7483cbe6cd144680364ad4b4416be48c7c5258a Mon Sep 17 00:00:00 2001 From: Jon goldberg Date: Mon, 19 Jan 2015 00:19:22 -0500 Subject: [PATCH] INFRA-132 batch 2 cleanup --- CRM/Admin/Form/Job.php | 2 +- CRM/Campaign/StateMachine/Search.php | 2 +- CRM/Case/BAO/Query.php | 2 +- CRM/Case/Form/Report.php | 2 +- CRM/Contribute/BAO/ContributionRecur.php | 2 +- CRM/Core/BAO/RecurringEntity.php | 62 +-- CRM/Core/BAO/UFGroup.php | 58 +- CRM/Core/Permission/Drupal.php | 4 +- CRM/Core/Region.php | 2 +- CRM/Core/Smarty.php | 4 +- CRM/Event/Form/Task/Badge.php | 2 +- CRM/Extension/Mapper.php | 4 +- CRM/Grant/BAO/Grant.php | 15 +- CRM/Mailing/Page/Browse.php | 4 +- CRM/Member/Form/Task/PDFLetterCommon.php | 8 +- CRM/Pledge/Page/Tab.php | 2 +- CRM/Report/Form/Case/TimeSpent.php | 7 +- CRM/Report/Form/Member/ContributionDetail.php | 506 +++++++++--------- CRM/Report/Form/Register.php | 2 +- CRM/Utils/System/Joomla.php | 26 +- CRM/Utils/Token.php | 46 +- api/v3/GroupOrganization.php | 2 +- api/v3/Im.php | 2 - api/v3/MembershipPayment.php | 2 +- api/v3/Setting.php | 31 +- tests/phpunit/CRM/Core/BAO/IMTest.php | 2 +- .../CRM/Event/BAO/AdditionalPaymentTest.php | 2 +- tests/phpunit/CRM/Extension/AllTests.php | 2 +- 28 files changed, 392 insertions(+), 413 deletions(-) diff --git a/CRM/Admin/Form/Job.php b/CRM/Admin/Form/Job.php index 114e3efa68..a9e9bfb944 100644 --- a/CRM/Admin/Form/Job.php +++ b/CRM/Admin/Form/Job.php @@ -83,7 +83,7 @@ class CRM_Admin_Form_Job extends CRM_Admin_Form { $this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array( 'CRM_Core_DAO_Job', - $this->_id + $this->_id, )); $this->add('text', 'description', ts('Description'), diff --git a/CRM/Campaign/StateMachine/Search.php b/CRM/Campaign/StateMachine/Search.php index 369c38e79c..aec137aa7f 100755 --- a/CRM/Campaign/StateMachine/Search.php +++ b/CRM/Campaign/StateMachine/Search.php @@ -44,7 +44,7 @@ class CRM_Campaign_StateMachine_Search extends CRM_Core_StateMachine { /** * Class constructor */ - function __construct($controller, $action = CRM_Core_Action::NONE) { + public function __construct($controller, $action = CRM_Core_Action::NONE) { parent::__construct($controller, $action); $this->_pages = array(); diff --git a/CRM/Case/BAO/Query.php b/CRM/Case/BAO/Query.php index b6c518d76c..7b4ab3423f 100644 --- a/CRM/Case/BAO/Query.php +++ b/CRM/Case/BAO/Query.php @@ -615,7 +615,7 @@ case_relation_type.id = case_relationship.relationship_type_id )"; * * @return array|null */ - static function defaultReturnProperties( + public static function defaultReturnProperties( $mode, $includeCustomFields = TRUE ) { diff --git a/CRM/Case/Form/Report.php b/CRM/Case/Form/Report.php index 935d5e7f56..66215cce56 100644 --- a/CRM/Case/Form/Report.php +++ b/CRM/Case/Form/Report.php @@ -61,7 +61,7 @@ class CRM_Case_Form_Report extends CRM_Core_Form { * * @return void */ - function preProcess() { + public function preProcess() { $this->_caseID = CRM_Utils_Request::retrieve('caseid', 'Integer', $this, TRUE); $this->_clientID = CRM_Utils_Request::retrieve('cid', 'Integer', $this, TRUE); $this->_activitySetName = CRM_Utils_Request::retrieve('asn', 'String', $this, TRUE); diff --git a/CRM/Contribute/BAO/ContributionRecur.php b/CRM/Contribute/BAO/ContributionRecur.php index 106091bf28..7ee091ff6f 100644 --- a/CRM/Contribute/BAO/ContributionRecur.php +++ b/CRM/Contribute/BAO/ContributionRecur.php @@ -111,7 +111,7 @@ class CRM_Contribute_BAO_ContributionRecur extends CRM_Contribute_DAO_Contributi * @param array $duplicates * (reference ) store ids of duplicate contribs. * - * @return boolean + * @return bool * true if duplicate, false otherwise */ public static function checkDuplicate($params, &$duplicates) { diff --git a/CRM/Core/BAO/RecurringEntity.php b/CRM/Core/BAO/RecurringEntity.php index c0bd54019d..aef586d931 100644 --- a/CRM/Core/BAO/RecurringEntity.php +++ b/CRM/Core/BAO/RecurringEntity.php @@ -58,34 +58,34 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { public static $status = NULL; - static $_recurringEntityHelper = - array( + static $_recurringEntityHelper + = array( 'civicrm_event' => array( 'helper_class' => 'CRM_Event_DAO_Event', 'delete_func' => 'delete', - 'pre_delete_func' => 'CRM_Event_Form_ManageEvent_Repeat::checkRegistrationForEvents' + 'pre_delete_func' => 'CRM_Event_Form_ManageEvent_Repeat::checkRegistrationForEvents', ), 'civicrm_activity' => array( 'helper_class' => 'CRM_Activity_DAO_Activity', 'delete_func' => 'delete', - 'pre_delete_func' => '' - ) + 'pre_delete_func' => '', + ), ); - static $_dateColumns = - array( + static $_dateColumns + = array( 'civicrm_event' => array( 'dateColumns' => array('start_date'), 'excludeDateRangeColumns' => array('start_date', 'end_date'), - 'intervalDateColumns' => array('end_date') + 'intervalDateColumns' => array('end_date'), ), 'civicrm_activity' => array( 'dateColumns' => array('activity_date_time'), - ) + ), ); - static $_tableDAOMapper = - array( + static $_tableDAOMapper + = array( 'civicrm_event' => 'CRM_Event_DAO_Event', 'civicrm_price_set_entity' => 'CRM_Price_DAO_PriceSetEntity', 'civicrm_uf_join' => 'CRM_Core_DAO_UFJoin', @@ -95,19 +95,19 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { 'civicrm_activity_contact' => 'CRM_Activity_DAO_ActivityContact', ); - static $_updateSkipFields = - array( + static $_updateSkipFields + = array( 'civicrm_event' => array('start_date', 'end_date'), 'civicrm_tell_friend' => array('entity_id'), 'civicrm_pcp_block' => array('entity_id'), 'civicrm_activity' => array('activity_date_time'), ); - static $_linkedEntitiesInfo = - array( + static $_linkedEntitiesInfo + = array( 'civicrm_tell_friend' => array( 'entity_id_col' => 'entity_id', - 'entity_table_col' => 'entity_table' + 'entity_table_col' => 'entity_table', ), 'civicrm_price_set_entity' => array( 'entity_id_col' => 'entity_id', @@ -121,7 +121,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { ), 'civicrm_pcp_block' => array( 'entity_id_col' => 'entity_id', - 'entity_table_col' => 'entity_table' + 'entity_table_col' => 'entity_table', ), ); @@ -178,11 +178,11 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * @return object */ public static function quickAdd($parentId, $entityId, $entityTable) { - $params = - array( + $params + = array( 'parent_id' => $parentId, 'entity_id' => $entityId, - 'entity_table' => $entityTable + 'entity_table' => $entityTable, ); return self::add($params); } @@ -433,10 +433,12 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { $query .= " AND entity_id != " . ($initiatorId ? "%3" : "%1"); } - if ($mode == '1') { // MODE = SINGLE + // MODE = SINGLE + if ($mode == '1') { $query .= " AND entity_id = %3"; } - elseif ($mode == '2') { // MODE = FUTURE + // MODE = FUTURE + elseif ($mode == '2') { $recurringEntityID = CRM_Core_DAO::singleValueQuery("SELECT id FROM civicrm_recurring_entity WHERE entity_id = %3 AND entity_table = %2", $queryParams); if ($recurringEntityID) { $query .= $includeParent ? " AND id >= %4" : " AND id > %4"; @@ -508,8 +510,8 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { if (!$includeParent) { $query .= " AND parent_id != %1"; } - $parentId = - CRM_Core_DAO::singleValueQuery($query, + $parentId + = CRM_Core_DAO::singleValueQuery($query, array( 1 => array($entityId, 'Integer'), 2 => array($entityTable, 'String'), @@ -714,7 +716,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { // linked entity doesn't exist. lets create them $newCriteria = array( $idCol => $val['id'], - $tableCol => $val['table'] + $tableCol => $val['table'], ); $linkedObj = CRM_Core_BAO_RecurringEntity::copyCreateEntity($obj->__table, array('id' => $obj->id), @@ -785,7 +787,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { * Name of the entity table * * - * @return boolean|CRM_Core_DAO_RecurringEntity + * @return bool|CRM_Core_DAO_RecurringEntity */ static public function delEntity($entityId, $entityTable, $isDelLinkedEntities = FALSE) { if (empty($entityId) || empty($entityTable)) { @@ -915,7 +917,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { } $dao = CRM_Core_DAO::executeQuery($query, array( - 1 => array($scheduleReminderId, 'Integer') + 1 => array($scheduleReminderId, 'Integer'), ) ); $dao->fetch(); @@ -1092,7 +1094,7 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { } $params = array( 1 => array($entityId, 'Integer'), - 2 => array($used_for, 'String') + 2 => array($used_for, 'String'), ); $dao = CRM_Core_DAO::executeQuery($query, $params); $dao->fetch(); @@ -1117,12 +1119,12 @@ class CRM_Core_BAO_RecurringEntity extends CRM_Core_DAO_RecurringEntity { } else { CRM_Core_Session::setStatus('Could not update mode for linked entities'); - return; + return NULL; } $entityTable = $linkedEntityTable; $params = array( 'entity_id' => $entityId, - 'entity_table' => $mainEntityTable + 'entity_table' => $mainEntityTable, ); $defaults = array(); CRM_Core_DAO::commonRetrieve($dao, $params, $defaults); diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index 0f1e6fdaa2..a798da1bf1 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -199,7 +199,7 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { * @return array * the fields that are listings related */ - static function getListingFields( + public static function getListingFields( $action, $visibility, $considerSelector = FALSE, @@ -278,7 +278,7 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { * @return array * the fields that belong to this ufgroup(s) */ - static function getFields( + public static function getFields( $id, $register = FALSE, $action = NULL, @@ -422,9 +422,9 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { * * @param CRM_Core_DAO_UFGroup|CRM_Core_DAO $group * @param CRM_Core_DAO_UFField|CRM_Core_DAO $field + * @param array $customFields * @param array $addressCustomFields * @param array $importableFields - * @param array $customFields * @param int $permissionType * Eg CRM_Core_Permission::CREATE. * @return array @@ -711,7 +711,7 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { * The action of the form. * * @pram boolean $register is this the registrtion form - * @return boolean + * @return bool * true if form is valid */ public static function isValid($userID, $title, $register = FALSE, $action = NULL) { @@ -765,7 +765,7 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { * @return string * the html for the form on success, otherwise empty string */ - static function getEditHTML( + public static function getEditHTML( $userID, $title, $action = NULL, @@ -1376,7 +1376,7 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { * @param int $id * Profile Id. * - * @return boolean + * @return bool * */ public static function usedByModule($id) { @@ -1401,7 +1401,7 @@ class CRM_Core_BAO_UFGroup extends CRM_Core_DAO_UFGroup { * @param int $id * Profile Id. * - * @return boolean + * @return bool * */ public static function del($id) { @@ -1739,7 +1739,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * Uf group id (profile id). * @param int $contactID * - * @return boolean + * @return bool * true or false */ public static function filterUFGroups($ufGroupId, $contactID = NULL) { @@ -1791,7 +1791,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * * @return null */ - static function buildProfile( + public static function buildProfile( &$form, &$field, $mode, @@ -1814,7 +1814,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) // do not display view fields in drupal registration form // CRM-4632 if ($view && $mode == CRM_Profile_Form::MODE_REGISTER) { - return; + return NULL; } if ($usedFor == 'onbehalf') { @@ -1841,14 +1841,13 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) if ($fieldName == 'image_URL' && $mode == CRM_Profile_Form::MODE_EDIT) { $deleteExtra = ts('Are you sure you want to delete contact image.'); $deleteURL = array( - CRM_Core_Action::DELETE => - array( - 'name' => ts('Delete Contact Image'), - 'url' => 'civicrm/contact/image', - 'qs' => 'reset=1&id=%%id%%&gid=%%gid%%&action=delete', - 'extra' => - 'onclick = "if (confirm( \'' . $deleteExtra . '\' ) ) this.href+=\'&confirmed=1\'; else return false;"', - ), + CRM_Core_Action::DELETE => array( + 'name' => ts('Delete Contact Image'), + 'url' => 'civicrm/contact/image', + 'qs' => 'reset=1&id=%%id%%&gid=%%gid%%&action=delete', + 'extra' => + 'onclick = "if (confirm( \'' . $deleteExtra . '\' ) ) this.href+=\'&confirmed=1\'; else return false;"', + ), ); $deleteURL = CRM_Core_Action::formLink($deleteURL, CRM_Core_Action::DELETE, @@ -2141,8 +2140,8 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) list($products, $options) = CRM_Contribute_BAO_Premium::getPremiumProductInfo(); $sel = &$form->addElement('hierselect', $name, $title); $products = array( - '0' => ts('- select -'), - ) + $products; + '0' => ts('- select -'), + ) + $products; $sel->setOptions(array($products, $options)); } elseif ($fieldName == 'payment_instrument') { @@ -2329,10 +2328,8 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * @param int $componentId * Id for specific components like contribute, event etc. * @param null $component - * - * @return null */ - static function setProfileDefaults( + public static function setProfileDefaults( $contactId, &$fields, &$defaults, $singleProfile = TRUE, $componentId = NULL, $component = NULL ) { @@ -2617,7 +2614,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) */ public static function getValidProfiles($required, $optional = NULL) { if (!is_array($required) || empty($required)) { - return; + return NULL; } $profiles = array(); @@ -2773,7 +2770,6 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * * @return void */ - public static function commonSendMail($contactID, &$values) { if (!$contactID || !$values) { return; @@ -3106,7 +3102,7 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) * @param array $groupTypes * With key having group type names. * - * @return Boolean + * @return bool */ public static function updateGroupTypes($gId, $groupTypes = array()) { if (!is_array($groupTypes) || !$gId) { @@ -3294,8 +3290,8 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) } elseif ($name == 'membership_type') { // since membership_type field is a hierselect - - $defaults[$fldName][0] = - CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $values['membership_type_id'], 'member_of_contact_id', 'id'); + $defaults[$fldName][0] + = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $values['membership_type_id'], 'member_of_contact_id', 'id'); $defaults[$fldName][1] = $values['membership_type_id']; } elseif ($name == 'membership_status') { @@ -3500,7 +3496,7 @@ SELECT group_id * @param array $profileIds * Associated array of profile ids. * - * @return boolean + * @return bool * true if profile is mixed */ public static function checkForMixProfiles($profileIds) { @@ -3550,7 +3546,7 @@ SELECT group_id /** * Determine of we show overlay profile or not * - * @return boolean + * @return bool * true if profile should be shown else false */ public static function showOverlayProfile() { @@ -3577,7 +3573,7 @@ SELECT group_id * @param int $profileId * @param string $groupType * - * @return Array + * @return array * group type values */ public static function groupTypeValues($profileId, $groupType = NULL) { diff --git a/CRM/Core/Permission/Drupal.php b/CRM/Core/Permission/Drupal.php index c36036be0d..39adcfa71e 100644 --- a/CRM/Core/Permission/Drupal.php +++ b/CRM/Core/Permission/Drupal.php @@ -70,7 +70,7 @@ class CRM_Core_Permission_Drupal extends CRM_Core_Permission_DrupalBase { * * @param int $contactID * - * @return boolean + * @return bool * true if yes, else false */ public function check($str, $contactID = NULL) { @@ -96,7 +96,7 @@ class CRM_Core_Permission_Drupal extends CRM_Core_Permission_DrupalBase { * @param array $array * The roles to check. * - * @return boolean + * @return bool * true if yes, else false */ public function checkGroupRole($array) { diff --git a/CRM/Core/Region.php b/CRM/Core/Region.php index 2de943d216..60b03a622c 100644 --- a/CRM/Core/Region.php +++ b/CRM/Core/Region.php @@ -198,7 +198,7 @@ class CRM_Core_Region { case 'jquery': $snippet['script'] = sprintf("CRM.\$(function(\$) {\n%s\n});", $snippet['jquery']); - // no break - continue processing as script + // no break - continue processing as script case 'script': if (!$allowCmsOverride || !$cms->addScript($snippet['script'], $this->_name)) { $html .= sprintf("\n", $snippet['script']); diff --git a/CRM/Core/Smarty.php b/CRM/Core/Smarty.php index 986d3ef8e6..4ac0a47ba3 100644 --- a/CRM/Core/Smarty.php +++ b/CRM/Core/Smarty.php @@ -117,8 +117,8 @@ class CRM_Core_Smarty extends Smarty { $customPluginsDir = NULL; if (isset($config->customPHPPathDir)) { - $customPluginsDir = - $config->customPHPPathDir . DIRECTORY_SEPARATOR . + $customPluginsDir + = $config->customPHPPathDir . DIRECTORY_SEPARATOR . 'CRM' . DIRECTORY_SEPARATOR . 'Core' . DIRECTORY_SEPARATOR . 'Smarty' . DIRECTORY_SEPARATOR . diff --git a/CRM/Event/Form/Task/Badge.php b/CRM/Event/Form/Task/Badge.php index b55c05c6cd..ee1ce947fc 100644 --- a/CRM/Event/Form/Task/Badge.php +++ b/CRM/Event/Form/Task/Badge.php @@ -97,7 +97,7 @@ class CRM_Event_Form_Task_Badge extends CRM_Event_Form_Task { 'badge_id', ts('Name Badge Format'), array( - '' => ts('- select -') + '' => ts('- select -'), ) + $label, TRUE ); diff --git a/CRM/Extension/Mapper.php b/CRM/Extension/Mapper.php index 0a6b59ae4e..0c39f30fe9 100755 --- a/CRM/Extension/Mapper.php +++ b/CRM/Extension/Mapper.php @@ -147,7 +147,7 @@ class CRM_Extension_Mapper { * @param string $key * A string which might be an extension key. * - * @return boolean + * @return bool * true if given string is an extension name */ public function isExtensionKey($key) { @@ -162,7 +162,7 @@ class CRM_Extension_Mapper { * @param string $clazz * A string which might be an extension class name. * - * @return boolean + * @return bool * true if given string is an extension class name */ public function isExtensionClass($clazz) { diff --git a/CRM/Grant/BAO/Grant.php b/CRM/Grant/BAO/Grant.php index 8a6a13d69b..c333b1d691 100644 --- a/CRM/Grant/BAO/Grant.php +++ b/CRM/Grant/BAO/Grant.php @@ -109,19 +109,6 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { return $og; } - /** - * Retrieve statistics for grants. - * - * - * @param bool $admin - * - * @return array - * Array of grant summary statistics - */ - public static function getGrantStatistics($admin = FALSE) { - $grantStatuses = array(); - } - /** * Fetch object based on array of properties * @@ -398,7 +385,7 @@ class CRM_Grant_BAO_Grant extends CRM_Grant_DAO_Grant { 'title' => ts('Grant Note'), 'name' => 'grant_note', 'data_type' => CRM_Utils_Type::T_TEXT, - ) + ), ); $fields = array_merge($fields, $grantFields, $grantNote, CRM_Core_BAO_CustomField::getFieldsForImport('Grant') diff --git a/CRM/Mailing/Page/Browse.php b/CRM/Mailing/Page/Browse.php index 4426aebd1f..7301ce0e3c 100644 --- a/CRM/Mailing/Page/Browse.php +++ b/CRM/Mailing/Page/Browse.php @@ -130,8 +130,8 @@ class CRM_Mailing_Page_Browse extends CRM_Core_Page { CRM_Mailing_BAO_MailingJob::runJobs_post(); } - $this->_sortByCharacter = - CRM_Utils_Request::retrieve('sortByCharacter', 'String', $this); + $this->_sortByCharacter + = CRM_Utils_Request::retrieve('sortByCharacter', 'String', $this); // CRM-11920 all should set sortByCharacter to null, not empty string if (strtolower($this->_sortByCharacter) == 'all' || !empty($_POST)) { diff --git a/CRM/Member/Form/Task/PDFLetterCommon.php b/CRM/Member/Form/Task/PDFLetterCommon.php index 7697c63706..b1d7f8ef52 100644 --- a/CRM/Member/Form/Task/PDFLetterCommon.php +++ b/CRM/Member/Form/Task/PDFLetterCommon.php @@ -21,11 +21,11 @@ class CRM_Member_Form_Task_PDFLetterCommon extends CRM_Contact_Form_Task_PDFLett */ public static function postProcessMembers(&$form, $membershipIDs, $skipOnHold, $skipDeceased, $contactIDs) { - list($formValues, $categories, $html_message, $messageToken, $returnProperties) = - self::processMessageTemplate($form); + list($formValues, $categories, $html_message, $messageToken, $returnProperties) + = self::processMessageTemplate($form); - $html = - self::generateHTML( + $html + = self::generateHTML( $membershipIDs, $returnProperties, $skipOnHold, diff --git a/CRM/Pledge/Page/Tab.php b/CRM/Pledge/Page/Tab.php index f0480a0e5f..24bf5c565f 100644 --- a/CRM/Pledge/Page/Tab.php +++ b/CRM/Pledge/Page/Tab.php @@ -39,7 +39,7 @@ class CRM_Pledge_Page_Tab extends CRM_Core_Page { /** * called when action is browse * - * @return null + * @return void */ public function browse() { $controller = new CRM_Core_Controller_Simple('CRM_Pledge_Form_Search', ts('Pledges'), $this->_action); diff --git a/CRM/Report/Form/Case/TimeSpent.php b/CRM/Report/Form/Case/TimeSpent.php index 1ef3fd7d0b..d4ebad28b7 100644 --- a/CRM/Report/Form/Case/TimeSpent.php +++ b/CRM/Report/Form/Case/TimeSpent.php @@ -98,10 +98,9 @@ class CRM_Report_Form_Case_TimeSpent extends CRM_Report_Form { ), ), 'filters' => array( - 'activity_date_time' => //'default' => 'this.month', - array( - 'operatorType' => CRM_Report_Form::OP_DATE, - ), + 'activity_date_time' => array( + 'operatorType' => CRM_Report_Form::OP_DATE, + ), 'subject' => array( 'title' => ts('Activity Subject'), 'operator' => 'like', diff --git a/CRM/Report/Form/Member/ContributionDetail.php b/CRM/Report/Form/Member/ContributionDetail.php index a9d844df1d..fa4d910e5c 100644 --- a/CRM/Report/Form/Member/ContributionDetail.php +++ b/CRM/Report/Form/Member/ContributionDetail.php @@ -58,284 +58,284 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form { asort($this->activeCampaigns); } $this->_columns = array( - 'civicrm_contact' => array( - 'dao' => 'CRM_Contact_DAO_Contact', - 'fields' => array( - 'sort_name' => array( - 'title' => ts('Donor Name'), - 'required' => TRUE, - 'no_repeat' => TRUE, - ), - 'first_name' => array( - 'title' => ts('First Name'), - 'no_repeat' => TRUE, - ), - 'last_name' => array( - 'title' => ts('Last Name'), - 'no_repeat' => TRUE, - ), - 'contact_type' => array( - 'title' => ts('Contact Type'), - 'no_repeat' => TRUE, - ), - 'contact_sub_type' => array( - 'title' => ts('Contact Subtype'), - 'no_repeat' => TRUE, - ), - 'do_not_email' => array( - 'title' => ts('Do Not Email'), - 'no_repeat' => TRUE, - ), - 'is_opt_out' => array( - 'title' => ts('No Bulk Email(Is Opt Out)'), - 'no_repeat' => TRUE, - ), - 'id' => array( - 'no_display' => TRUE, - 'required' => TRUE, - 'csv_display' => TRUE, - 'title' => ts('Contact ID'), - ), + 'civicrm_contact' => array( + 'dao' => 'CRM_Contact_DAO_Contact', + 'fields' => array( + 'sort_name' => array( + 'title' => ts('Donor Name'), + 'required' => TRUE, + 'no_repeat' => TRUE, ), - 'filters' => array( - 'sort_name' => array( - 'title' => ts('Donor Name'), - 'operator' => 'like', - ), - 'id' => array( - 'title' => ts('Contact ID'), - 'no_display' => TRUE, - ), + 'first_name' => array( + 'title' => ts('First Name'), + 'no_repeat' => TRUE, + ), + 'last_name' => array( + 'title' => ts('Last Name'), + 'no_repeat' => TRUE, + ), + 'contact_type' => array( + 'title' => ts('Contact Type'), + 'no_repeat' => TRUE, + ), + 'contact_sub_type' => array( + 'title' => ts('Contact Subtype'), + 'no_repeat' => TRUE, + ), + 'do_not_email' => array( + 'title' => ts('Do Not Email'), + 'no_repeat' => TRUE, + ), + 'is_opt_out' => array( + 'title' => ts('No Bulk Email(Is Opt Out)'), + 'no_repeat' => TRUE, + ), + 'id' => array( + 'no_display' => TRUE, + 'required' => TRUE, + 'csv_display' => TRUE, + 'title' => ts('Contact ID'), ), - 'grouping' => 'contact-fields', ), - 'civicrm_email' => array( - 'dao' => 'CRM_Core_DAO_Email', - 'fields' => array( - 'email' => array( - 'title' => ts('Donor Email'), - 'default' => TRUE, - 'no_repeat' => TRUE, - ), + 'filters' => array( + 'sort_name' => array( + 'title' => ts('Donor Name'), + 'operator' => 'like', + ), + 'id' => array( + 'title' => ts('Contact ID'), + 'no_display' => TRUE, ), - 'grouping' => 'contact-fields', ), - 'civicrm_phone' => array( - 'dao' => 'CRM_Core_DAO_Phone', - 'fields' => array( - 'phone' => array( - 'title' => ts('Donor Phone'), - 'default' => TRUE, - 'no_repeat' => TRUE, - ), + 'grouping' => 'contact-fields', + ), + 'civicrm_email' => array( + 'dao' => 'CRM_Core_DAO_Email', + 'fields' => array( + 'email' => array( + 'title' => ts('Donor Email'), + 'default' => TRUE, + 'no_repeat' => TRUE, ), - 'grouping' => 'contact-fields', ), - 'first_donation' => array( - 'dao' => 'CRM_Contribute_DAO_Contribution', - 'fields' => array( - 'first_donation_date' => array( - 'title' => ts('First Contribution Date'), - 'base_field' => 'receive_date', - 'no_repeat' => TRUE, - ), - 'first_donation_amount' => array( - 'title' => ts('First Contribution Amount'), - 'base_field' => 'total_amount', - 'no_repeat' => TRUE, - ), + 'grouping' => 'contact-fields', + ), + 'civicrm_phone' => array( + 'dao' => 'CRM_Core_DAO_Phone', + 'fields' => array( + 'phone' => array( + 'title' => ts('Donor Phone'), + 'default' => TRUE, + 'no_repeat' => TRUE, ), ), - 'civicrm_contribution' => array( - 'dao' => 'CRM_Contribute_DAO_Contribution', - 'fields' => array( - 'contribution_id' => array( - 'name' => 'id', - 'no_display' => TRUE, - 'required' => TRUE, - 'csv_display' => TRUE, - 'title' => ts('Contribution ID'), - ), - 'financial_type_id' => array( - 'title' => ts('Financial Type'), - 'default' => TRUE, - ), - 'contribution_recur_id' => array( - 'title' => ts('Recurring Contribution Id'), - 'name' => 'contribution_recur_id', - 'required' => TRUE, - 'no_display' => TRUE, - 'csv_display' => TRUE, - ), - 'contribution_status_id' => array( - 'title' => ts('Contribution Status'), - ), - 'payment_instrument_id' => array( - 'title' => ts('Payment Type'), - ), - 'contribution_source' => array( - 'name' => 'source', - 'title' => ts('Contribution Source'), - ), - 'currency' => array( - 'required' => TRUE, - 'no_display' => TRUE, - ), - 'trxn_id' => NULL, - 'receive_date' => array('default' => TRUE), - 'receipt_date' => NULL, - 'fee_amount' => NULL, - 'net_amount' => NULL, - 'total_amount' => array( - 'title' => ts('Amount'), - 'required' => TRUE, - ), + 'grouping' => 'contact-fields', + ), + 'first_donation' => array( + 'dao' => 'CRM_Contribute_DAO_Contribution', + 'fields' => array( + 'first_donation_date' => array( + 'title' => ts('First Contribution Date'), + 'base_field' => 'receive_date', + 'no_repeat' => TRUE, ), - 'filters' => array( - 'receive_date' => array('operatorType' => CRM_Report_Form::OP_DATE), - 'financial_type_id' => array( - 'title' => ts('Financial Type'), - 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'options' => CRM_Contribute_PseudoConstant::financialType(), - ), - 'currency' => array( - 'title' => 'Currency', - 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'options' => CRM_Core_OptionGroup::values('currencies_enabled'), - 'default' => NULL, - 'type' => CRM_Utils_Type::T_STRING, - ), - 'payment_instrument_id' => array( - 'title' => ts('Payment Type'), - 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'options' => CRM_Contribute_PseudoConstant::paymentInstrument(), - ), - 'contribution_status_id' => array( - 'title' => ts('Contribution Status'), - 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'options' => CRM_Contribute_PseudoConstant::contributionStatus(), - 'default' => array(1), - ), - 'total_amount' => array('title' => ts('Contribution Amount')), + 'first_donation_amount' => array( + 'title' => ts('First Contribution Amount'), + 'base_field' => 'total_amount', + 'no_repeat' => TRUE, ), - 'grouping' => 'contri-fields', ), - 'civicrm_product' => array( - 'dao' => 'CRM_Contribute_DAO_Product', - 'fields' => array( - 'product_name' => array( - 'name' => 'name', - 'title' => ts('Premium'), - ), + ), + 'civicrm_contribution' => array( + 'dao' => 'CRM_Contribute_DAO_Contribution', + 'fields' => array( + 'contribution_id' => array( + 'name' => 'id', + 'no_display' => TRUE, + 'required' => TRUE, + 'csv_display' => TRUE, + 'title' => ts('Contribution ID'), + ), + 'financial_type_id' => array( + 'title' => ts('Financial Type'), + 'default' => TRUE, + ), + 'contribution_recur_id' => array( + 'title' => ts('Recurring Contribution Id'), + 'name' => 'contribution_recur_id', + 'required' => TRUE, + 'no_display' => TRUE, + 'csv_display' => TRUE, + ), + 'contribution_status_id' => array( + 'title' => ts('Contribution Status'), + ), + 'payment_instrument_id' => array( + 'title' => ts('Payment Type'), + ), + 'contribution_source' => array( + 'name' => 'source', + 'title' => ts('Contribution Source'), + ), + 'currency' => array( + 'required' => TRUE, + 'no_display' => TRUE, + ), + 'trxn_id' => NULL, + 'receive_date' => array('default' => TRUE), + 'receipt_date' => NULL, + 'fee_amount' => NULL, + 'net_amount' => NULL, + 'total_amount' => array( + 'title' => ts('Amount'), + 'required' => TRUE, ), ), - 'civicrm_contribution_product' => array( - 'dao' => 'CRM_Contribute_DAO_ContributionProduct', - 'fields' => array( - 'product_id' => array( - 'no_display' => TRUE, - ), - 'product_option' => array( - 'title' => ts('Premium Option'), - ), - 'contribution_id' => array( - 'no_display' => TRUE, - ), + 'filters' => array( + 'receive_date' => array('operatorType' => CRM_Report_Form::OP_DATE), + 'financial_type_id' => array( + 'title' => ts('Financial Type'), + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'options' => CRM_Contribute_PseudoConstant::financialType(), + ), + 'currency' => array( + 'title' => 'Currency', + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'options' => CRM_Core_OptionGroup::values('currencies_enabled'), + 'default' => NULL, + 'type' => CRM_Utils_Type::T_STRING, ), + 'payment_instrument_id' => array( + 'title' => ts('Payment Type'), + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'options' => CRM_Contribute_PseudoConstant::paymentInstrument(), + ), + 'contribution_status_id' => array( + 'title' => ts('Contribution Status'), + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'options' => CRM_Contribute_PseudoConstant::contributionStatus(), + 'default' => array(1), + ), + 'total_amount' => array('title' => ts('Contribution Amount')), ), - 'civicrm_contribution_ordinality' => array( - 'dao' => 'CRM_Contribute_DAO_Contribution', - 'alias' => 'cordinality', - 'filters' => array( - 'ordinality' => array( - 'title' => ts('Contribution Ordinality'), - 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'options' => array( - 0 => 'First by Contributor', - 1 => 'Second or Later by Contributor', - ), - ), + 'grouping' => 'contri-fields', + ), + 'civicrm_product' => array( + 'dao' => 'CRM_Contribute_DAO_Product', + 'fields' => array( + 'product_name' => array( + 'name' => 'name', + 'title' => ts('Premium'), ), ), - 'civicrm_membership' => array( - 'dao' => 'CRM_Member_DAO_Membership', - 'fields' => array( - 'membership_type_id' => array( - 'title' => ts('Membership Type'), - 'required' => TRUE, - 'no_repeat' => TRUE, - ), - 'membership_start_date' => array( - 'title' => ts('Start Date'), - 'default' => TRUE, - ), - 'membership_end_date' => array( - 'title' => ts('End Date'), - 'default' => TRUE, - ), - 'join_date' => array( - 'title' => ts('Join Date'), - 'default' => TRUE, - ), - 'source' => array('title' => ts('Membership Source')), - ), - 'filters' => array( - 'join_date' => array('operatorType' => CRM_Report_Form::OP_DATE), - 'membership_start_date' => array('operatorType' => CRM_Report_Form::OP_DATE), - 'membership_end_date' => array('operatorType' => CRM_Report_Form::OP_DATE), - 'owner_membership_id' => array( - 'title' => ts('Membership Owner ID'), - 'operatorType' => CRM_Report_Form::OP_INT, - ), - 'tid' => array( - 'name' => 'membership_type_id', - 'title' => ts('Membership Types'), - 'type' => CRM_Utils_Type::T_INT, - 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'options' => CRM_Member_PseudoConstant::membershipType(), - ), + ), + 'civicrm_contribution_product' => array( + 'dao' => 'CRM_Contribute_DAO_ContributionProduct', + 'fields' => array( + 'product_id' => array( + 'no_display' => TRUE, + ), + 'product_option' => array( + 'title' => ts('Premium Option'), + ), + 'contribution_id' => array( + 'no_display' => TRUE, ), - 'grouping' => 'member-fields', ), - 'civicrm_membership_status' => array( - 'dao' => 'CRM_Member_DAO_MembershipStatus', - 'alias' => 'mem_status', - 'fields' => array( - 'membership_status_name' => array( - 'name' => 'name', - 'title' => ts('Membership Status'), - 'default' => TRUE, + ), + 'civicrm_contribution_ordinality' => array( + 'dao' => 'CRM_Contribute_DAO_Contribution', + 'alias' => 'cordinality', + 'filters' => array( + 'ordinality' => array( + 'title' => ts('Contribution Ordinality'), + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'options' => array( + 0 => 'First by Contributor', + 1 => 'Second or Later by Contributor', ), ), - 'filters' => array( - 'sid' => array( - 'name' => 'id', - 'title' => ts('Membership Status'), - 'type' => CRM_Utils_Type::T_INT, - 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'options' => CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label'), - ), + ), + ), + 'civicrm_membership' => array( + 'dao' => 'CRM_Member_DAO_Membership', + 'fields' => array( + 'membership_type_id' => array( + 'title' => ts('Membership Type'), + 'required' => TRUE, + 'no_repeat' => TRUE, + ), + 'membership_start_date' => array( + 'title' => ts('Start Date'), + 'default' => TRUE, ), - 'grouping' => 'member-fields', + 'membership_end_date' => array( + 'title' => ts('End Date'), + 'default' => TRUE, + ), + 'join_date' => array( + 'title' => ts('Join Date'), + 'default' => TRUE, + ), + 'source' => array('title' => ts('Membership Source')), ), - 'civicrm_note' => array( - 'dao' => 'CRM_Core_DAO_Note', - 'fields' => array( - 'contribution_note' => array( - 'name' => 'note', - 'title' => ts('Contribution Note'), - ), + 'filters' => array( + 'join_date' => array('operatorType' => CRM_Report_Form::OP_DATE), + 'membership_start_date' => array('operatorType' => CRM_Report_Form::OP_DATE), + 'membership_end_date' => array('operatorType' => CRM_Report_Form::OP_DATE), + 'owner_membership_id' => array( + 'title' => ts('Membership Owner ID'), + 'operatorType' => CRM_Report_Form::OP_INT, ), - 'filters' => array( - 'note' => array( - 'name' => 'note', - 'title' => ts('Contribution Note'), - 'operator' => 'like', - 'type' => CRM_Utils_Type::T_STRING, - ), + 'tid' => array( + 'name' => 'membership_type_id', + 'title' => ts('Membership Types'), + 'type' => CRM_Utils_Type::T_INT, + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'options' => CRM_Member_PseudoConstant::membershipType(), + ), + ), + 'grouping' => 'member-fields', + ), + 'civicrm_membership_status' => array( + 'dao' => 'CRM_Member_DAO_MembershipStatus', + 'alias' => 'mem_status', + 'fields' => array( + 'membership_status_name' => array( + 'name' => 'name', + 'title' => ts('Membership Status'), + 'default' => TRUE, + ), + ), + 'filters' => array( + 'sid' => array( + 'name' => 'id', + 'title' => ts('Membership Status'), + 'type' => CRM_Utils_Type::T_INT, + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'options' => CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label'), + ), + ), + 'grouping' => 'member-fields', + ), + 'civicrm_note' => array( + 'dao' => 'CRM_Core_DAO_Note', + 'fields' => array( + 'contribution_note' => array( + 'name' => 'note', + 'title' => ts('Contribution Note'), + ), + ), + 'filters' => array( + 'note' => array( + 'name' => 'note', + 'title' => ts('Contribution Note'), + 'operator' => 'like', + 'type' => CRM_Utils_Type::T_STRING, ), ), - ) + $this->addAddressFields(FALSE); + ), + ) + $this->addAddressFields(FALSE); $this->_groupFilter = TRUE; $this->_tagFilter = TRUE; @@ -614,8 +614,8 @@ class CRM_Report_Form_Member_ContributionDetail extends CRM_Report_Form { $dao = CRM_Core_DAO::executeQuery($sql); $totalAmount = $average = array(); while ($dao->fetch()) { - $totalAmount[] = - CRM_Utils_Money::format($dao->amount, $dao->currency) . "(" . + $totalAmount[] + = CRM_Utils_Money::format($dao->amount, $dao->currency) . "(" . $dao->count . ")"; $average[] = CRM_Utils_Money::format($dao->avg, $dao->currency); } diff --git a/CRM/Report/Form/Register.php b/CRM/Report/Form/Register.php index 2f8e872bed..3de997e5a8 100644 --- a/CRM/Report/Form/Register.php +++ b/CRM/Report/Form/Register.php @@ -199,7 +199,7 @@ class CRM_Report_Form_Register extends CRM_Core_Form { $optionValue = CRM_Core_OptionValue::addOptionValue($params, $groupParams, $this->_action, $this->_id); CRM_Core_Session::setStatus(ts('The %1 \'%2\' has been saved.', array( 1 => 'Report Template', - 2 => $optionValue->label + 2 => $optionValue->label, )), ts('Saved'), 'success'); CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/report/options/report_template', "reset=1")); } diff --git a/CRM/Utils/System/Joomla.php b/CRM/Utils/System/Joomla.php index b6037f93f8..17ca098f68 100644 --- a/CRM/Utils/System/Joomla.php +++ b/CRM/Utils/System/Joomla.php @@ -194,8 +194,6 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { $document = JFactory::getDocument(); $document->setTitle($title); - - return; } /** @@ -229,7 +227,6 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { } } $template->assign_by_ref('breadcrumb', $bc); - return; } /** @@ -240,7 +237,6 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * @return void */ public function resetBreadCrumb() { - return; } /** @@ -360,7 +356,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * @return string * an HTML string containing a link to the given path. */ - function url( + public function url( $path = NULL, $query = NULL, $absolute = TRUE, $fragment = NULL, $htmlize = TRUE, $frontend = FALSE, $forceBackend = FALSE @@ -409,7 +405,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { $joomlaVersion = JVERSION; } else { - $jversion = new JVersion; + $jversion = new JVersion(); $joomlaVersion = $jversion->getShortVersion(); } @@ -424,11 +420,10 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * Rewrite various system urls to https * * @return void - * access public + * access public */ public function mapConfigToSSL() { // dont need to do anything, let CMS handle their own switch to SSL - return; } /** @@ -517,7 +512,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { $joomlaBase = dirname(dirname(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))))); if (!defined('JVERSION')) { require $joomlaBase . '/libraries/cms/version/version.php'; - $jversion = new JVersion; + $jversion = new JVersion(); define('JVERSION', $jversion->getShortVersion()); } @@ -589,7 +584,6 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * The message to set. */ public function setMessage($message) { - return; } /** @@ -630,7 +624,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { */ public function getVersion() { if (class_exists('JVersion')) { - $version = new JVersion; + $version = new JVersion(); return $version->getShortVersion(); } else { @@ -675,7 +669,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { // Files may be in different places depending on Joomla version if (!defined('JVERSION')) { require $joomlaBase . '/libraries/cms/version/version.php'; - $jversion = new JVersion; + $jversion = new JVersion(); define('JVERSION', $jversion->getShortVersion()); } @@ -700,7 +694,7 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { /** * Check is user logged in. * - * @return boolean + * @return bool */ public function isUserLoggedIn() { $user = JFactory::getUser(); @@ -839,9 +833,9 @@ class CRM_Utils_System_Joomla extends CRM_Utils_System_Base { * * @return array * array - * - $url, (Joomla - non admin url) - * - $siteName, - * - $siteRoot + * - $url, (Joomla - non admin url) + * - $siteName, + * - $siteRoot */ public function getDefaultSiteSettings($dir) { $config = CRM_Core_Config::singleton(); diff --git a/CRM/Utils/Token.php b/CRM/Utils/Token.php index 5bad565d82..6e566cec97 100644 --- a/CRM/Utils/Token.php +++ b/CRM/Utils/Token.php @@ -151,7 +151,7 @@ class CRM_Utils_Token { * @param string $str * The string to search. * - * @return boolean + * @return bool * Was there a match */ public static function token_match($type, $var, &$str) { @@ -332,8 +332,8 @@ class CRM_Utils_Token { * The processed string */ public static function &replaceOrgTokens($str, &$org, $html = FALSE, $escapeSmarty = FALSE) { - self::$_tokens['org'] = - array_merge( + self::$_tokens['org'] + = array_merge( array_keys(CRM_Contact_BAO_Contact::importableFields('Organization')), array('address', 'display_name', 'checksum', 'contact_id') ); @@ -653,8 +653,8 @@ class CRM_Utils_Token { if (self::$_tokens[$key] == NULL) { /* This should come from UF */ - self::$_tokens[$key] = - array_merge( + self::$_tokens[$key] + = array_merge( array_keys(CRM_Contact_BAO_Contact::exportableFields('All')), array('checksum', 'contact_id') ); @@ -699,8 +699,8 @@ class CRM_Utils_Token { if (self::$_tokens['contact'] == NULL) { /* This should come from UF */ - self::$_tokens['contact'] = - array_merge( + self::$_tokens['contact'] + = array_merge( array_keys(CRM_Contact_BAO_Contact::exportableFields('All')), array('checksum', 'contact_id') ); @@ -762,7 +762,9 @@ class CRM_Utils_Token { if ($escapeSmarty && !($returnBlankToken && $noReplace) - ) { // $returnBlankToken means the caller wants to do further attempts at processing unreplaced tokens -- so don't escape them yet in this case. + ) { + // $returnBlankToken means the caller wants to do further attempts at + // processing unreplaced tokens -- so don't escape them yet in this case. $value = self::tokenEscapeSmarty($value); } @@ -879,7 +881,7 @@ class CRM_Utils_Token { * Replace tokens with html or plain text. * @param int $contact_id * The contact ID. - * @param string hash The security hash of the unsub event + * @param string $hash The security hash of the unsub event * * @return string * The processed string @@ -925,7 +927,7 @@ class CRM_Utils_Token { * Replace tokens with html or plain text. * @param int $contact_id * The contact ID. - * @param string hash The security hash of the resub event + * @param string $hash The security hash of the resub event * * @return string * The processed string @@ -1150,9 +1152,9 @@ class CRM_Utils_Token { * @param $contactIDs * @param array $returnProperties * Of required properties. - * @param bool $skipOnHoldDon 't return on_hold contact info also. + * @param bool $skipOnHold Don't return on_hold contact info also. * Don't return on_hold contact info also. - * @param bool $skipDeceasedDon 't return deceased contact info. + * @param bool $skipDeceased Don't return deceased contact info. * Don't return deceased contact info. * @param array $extraParams * Extra params. @@ -1164,7 +1166,7 @@ class CRM_Utils_Token { * * @return array */ - static function getTokenDetails( + public static function getTokenDetails( $contactIDs, $returnProperties = NULL, $skipOnHold = TRUE, @@ -1262,7 +1264,7 @@ class CRM_Utils_Token { foreach (array( 'email_greeting', 'postal_greeting', - 'addressee' + 'addressee', ) as $val) { if (!empty($contactDetails[$contactID][$val])) { $contactDetails[$contactID][$val] = $contactDetails[$contactID]["{$val}_display"]; @@ -1300,7 +1302,7 @@ class CRM_Utils_Token { * contactDetails with hooks swapped out */ public function getAnonymousTokenDetails($contactIDs = array( - 0 + 0, ), $returnProperties = NULL, $skipOnHold = TRUE, @@ -1335,14 +1337,15 @@ class CRM_Utils_Token { * * @return array */ - static function getContributionTokenDetails( + public static function getContributionTokenDetails( $contributionIDs, $returnProperties = NULL, $extraParams = NULL, $tokens = array(), $className = NULL ) { - //@todo - this function basically replications calling civicrm_api3('contribution', 'get', array('id' => array('IN' => array()) + //@todo - this function basically replicates calling + //civicrm_api3('contribution', 'get', array('id' => array('IN' => array()) if (empty($contributionIDs)) { // putting a fatal here so we can track if/when this happens CRM_Core_Error::fatal(); @@ -1394,7 +1397,7 @@ class CRM_Utils_Token { public static function getMembershipTokenDetails($membershipIDs) { $memberships = civicrm_api3('membership', 'get', array( 'options' => array('limit' => 200000), - 'membership_id' => array('IN' => (array) $membershipIDs) + 'membership_id' => array('IN' => (array) $membershipIDs), )); return $memberships['values']; } @@ -1420,7 +1423,8 @@ class CRM_Utils_Token { // check if there are any unevaluated tokens $greetingTokens = self::getTokens($tokenString); - // $greetingTokens not empty, means there are few tokens which are not evaluated, like custom data etc + // $greetingTokens not empty, means there are few tokens which are not + // evaluated, like custom data etc // so retrieve it from database if (!empty($greetingTokens) && array_key_exists('contact', $greetingTokens)) { $greetingsReturnProperties = array_flip(CRM_Utils_Array::value('contact', $greetingTokens)); @@ -1485,7 +1489,7 @@ class CRM_Utils_Token { foreach (array( 'html', 'text', - 'subject' + 'subject', ) as $prop) { if (!isset($tokens[$prop])) { continue; @@ -1713,7 +1717,7 @@ class CRM_Utils_Token { try { $value = civicrm_api3('membership_type', 'getvalue', array( 'id' => $membership['membership_type_id'], - 'return' => 'minimum_fee' + 'return' => 'minimum_fee', )); } catch (CiviCRM_API3_Exception $e) { diff --git a/api/v3/GroupOrganization.php b/api/v3/GroupOrganization.php index 759371df7b..baca0dd3b9 100644 --- a/api/v3/GroupOrganization.php +++ b/api/v3/GroupOrganization.php @@ -99,7 +99,7 @@ function _civicrm_api3_group_organization_create_spec(&$params) { * * @return array * API Result - * {@getfields GroupOrganization_delete} + * {@getfields GroupOrganization_delete} * @example GroupOrganizationDelete.php */ function civicrm_api3_group_organization_delete($params) { diff --git a/api/v3/Im.php b/api/v3/Im.php index 39dcb176af..388474666c 100644 --- a/api/v3/Im.php +++ b/api/v3/Im.php @@ -75,8 +75,6 @@ function civicrm_api3_im_delete($params) { /** * Retrieve one or more IM * - * @param mixed[] (reference ) input parameters - * {@getfields im_get} * @param array $params * An associative array of name/value pairs. * diff --git a/api/v3/MembershipPayment.php b/api/v3/MembershipPayment.php index 71de334053..0e15f03a74 100644 --- a/api/v3/MembershipPayment.php +++ b/api/v3/MembershipPayment.php @@ -43,7 +43,7 @@ * * @return array * (reference ) membership_payment_id of created or updated record - * {@getfields MembershipPayment_create} + * {@getfields MembershipPayment_create} * @example MembershipPaymentCreate.php */ function civicrm_api3_membership_payment_create($params) { diff --git a/api/v3/Setting.php b/api/v3/Setting.php index 797cb8537d..c1d6b9086a 100644 --- a/api/v3/Setting.php +++ b/api/v3/Setting.php @@ -35,7 +35,6 @@ * @param array $params * @return array */ - function civicrm_api3_setting_getfields($params) { if (!empty($params['action']) && strtolower($params['action']) == 'getvalue') { $result = array( @@ -48,7 +47,7 @@ function civicrm_api3_setting_getfields($params) { 'title' => 'Setting Group', 'description' => 'Settings Group. This is required if the setting is not stored in config', 'type' => CRM_Utils_Type::T_STRING), - ); + ); return civicrm_api3_create_success($result, $params, 'setting', 'getfields'); } if (!empty($params['name'])) { @@ -218,7 +217,7 @@ function _civicrm_api3_setting_fill_spec(&$params) { * * @return array * api result array - * {@getfields setting_create} + * {@getfields setting_create} */ function civicrm_api3_setting_create($params) { $domains = _civicrm_api3_setting_getDomainArray($params); @@ -238,11 +237,11 @@ function _civicrm_api3_setting_create_spec(&$params) { 'title' => 'Setting Domain', 'description' => 'if you do not pass in a domain id this will default to the current domain an array or "all" are acceptable values for multiple domains', - ); + ); $params['group'] = array( - 'title' => 'Setting Group', - 'description' => 'if you know the group defining it will make the api more efficient', - ); + 'title' => 'Setting Group', + 'description' => 'if you know the group defining it will make the api more efficient', + ); } /** @@ -254,7 +253,7 @@ function _civicrm_api3_setting_create_spec(&$params) { * * @return array * Array of matching settings - * {@getfields setting_get} + * {@getfields setting_get} */ function civicrm_api3_setting_get($params) { $domains = _civicrm_api3_setting_getDomainArray($params); @@ -288,7 +287,7 @@ function _civicrm_api3_setting_get_spec(&$params) { * * @return array * Array of matching settings - * {@getfields setting_get} + * {@getfields setting_get} */ function civicrm_api3_setting_getvalue($params) { $config = CRM_Core_Config::singleton(); @@ -314,21 +313,21 @@ function civicrm_api3_setting_getvalue($params) { function _civicrm_api3_setting_getvalue_spec(&$params) { $params['group'] = array( - 'title' => 'Settings Group', - 'api.required' => TRUE, + 'title' => 'Settings Group', + 'api.required' => TRUE, ); $params['name'] = array( - 'title' => 'Setting Name', - 'api.aliases' => array('return'), + 'title' => 'Setting Name', + 'api.aliases' => array('return'), ); $params['default_value'] = array( - 'title' => 'Default Value', + 'title' => 'Default Value', ); $params['component_id'] = array( - 'title' => 'Component Id', + 'title' => 'Component Id', ); $params['contact_id'] = array( - 'title' => 'Contact Id', + 'title' => 'Contact Id', ); $params['domain_id'] = array( 'title' => 'Setting Domain', diff --git a/tests/phpunit/CRM/Core/BAO/IMTest.php b/tests/phpunit/CRM/Core/BAO/IMTest.php index a3b9e581f1..3da812863a 100644 --- a/tests/phpunit/CRM/Core/BAO/IMTest.php +++ b/tests/phpunit/CRM/Core/BAO/IMTest.php @@ -55,7 +55,7 @@ class CRM_Core_BAO_IMTest extends CiviUnitTestCase { * AllIMs() method - get all IMs for our contact, with primary IM first */ public function testAllIMs() { - $op = new PHPUnit_Extensions_Database_Operation_Insert; + $op = new PHPUnit_Extensions_Database_Operation_Insert(); $op->execute( $this->_dbconn, $this->createFlatXMLDataSet(dirname(__FILE__) . '/dataset/im_test.xml') diff --git a/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php b/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php index fcd44b520a..66722da64c 100644 --- a/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php +++ b/tests/phpunit/CRM/Event/BAO/AdditionalPaymentTest.php @@ -149,7 +149,7 @@ class CRM_Event_BAO_AdditionalPaymentTest extends CiviUnitTestCase { // add participant payment entry $this->callAPISuccess('participant_payment', 'create', array( 'participant_id' => $participant['id'], - 'contribution_id' => $contributionId + 'contribution_id' => $contributionId, )); // -- processing priceSet using the BAO diff --git a/tests/phpunit/CRM/Extension/AllTests.php b/tests/phpunit/CRM/Extension/AllTests.php index 98ca8c9e7e..70c2eb51ac 100644 --- a/tests/phpunit/CRM/Extension/AllTests.php +++ b/tests/phpunit/CRM/Extension/AllTests.php @@ -47,7 +47,7 @@ class CRM_Extension_AllTests extends CiviTestSuite { */ private static function getInstance() { if (is_null(self::$instance)) { - self::$instance = new self; + self::$instance = new self(); } return self::$instance; } -- 2.25.1