From c301f76e83796cab7a73e8edf3129013f23cf339 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Sun, 1 Feb 2015 20:55:14 +0530 Subject: [PATCH] INFRA-132 - Batch #7 --- CRM/ACL/Page/ACLBasic.php | 2 +- CRM/Admin/Form/ScheduleReminders.php | 3 +- CRM/Case/Info.php | 2 +- CRM/Contact/BAO/Relationship.php | 24 +- CRM/Contact/Form/Edit/IM.php | 2 +- .../Form/ContributionPage/Settings.php | 35 ++- CRM/Contribute/Import/Form/DataSource.php | 2 +- CRM/Core/BAO/MailSettings.php | 4 +- CRM/Core/I18n/SchemaStructure_3_0_alpha1.php | 4 +- CRM/Core/Payment/eWAY.php | 44 ++-- CRM/Core/Permission/DrupalBase.php | 2 +- CRM/Core/Permission/Joomla.php | 4 +- CRM/Custom/Import/Form/DataSource.php | 2 +- CRM/Dedupe/Merger.php | 25 +- CRM/Event/Page/Tab.php | 4 - CRM/Financial/Page/AJAX.php | 140 +++++------ CRM/Grant/Form/Task/Delete.php | 2 +- CRM/Mailing/Form/Unsubscribe.php | 3 - CRM/Pledge/Form/Task/Delete.php | 6 +- CRM/Pledge/Info.php | 2 +- CRM/Profile/Selector/Listings.php | 32 ++- CRM/Report/Form/Contribute/History.php | 230 +++++++++--------- CRM/Report/Form/Pledge/Summary.php | 218 ++++++++--------- CRM/Utils/Hook/Soap.php | 4 +- CRM/Utils/SoapServer.php | 4 +- CRM/Utils/System.php | 18 +- CRM/Utils/System/Drupal.php | 11 +- CRM/Utils/System/UnitTests.php | 21 +- CRM/Utils/Tree.php | 22 +- CRM/Widget/Widget.php | 2 +- bin/csv/delete.php | 2 +- tests/phpunit/CRM/Activity/AllTests.php | 2 +- tests/phpunit/CRM/Core/Config/MailerTest.php | 24 +- .../CRM/Core/Payment/PayPalProIPNTest.php | 16 +- tests/phpunit/CiviTest/AuthorizeNet.php | 2 +- .../phpunit/WebTest/Case/AddCaseTypeTest.php | 2 +- tests/phpunit/api/v3/ActivityTest.php | 60 ++--- 37 files changed, 472 insertions(+), 510 deletions(-) diff --git a/CRM/ACL/Page/ACLBasic.php b/CRM/ACL/Page/ACLBasic.php index 09f260b79b..4f83ddeba1 100644 --- a/CRM/ACL/Page/ACLBasic.php +++ b/CRM/ACL/Page/ACLBasic.php @@ -112,7 +112,7 @@ class CRM_ACL_Page_ACLBasic extends CRM_Core_Page_Basic { array( 'title' => ts('Access Control'), 'url' => CRM_Utils_System::url('civicrm/admin/access', 'reset=1'), - ) + ), ); CRM_Utils_System::appendBreadCrumb($breadCrumb); diff --git a/CRM/Admin/Form/ScheduleReminders.php b/CRM/Admin/Form/ScheduleReminders.php index 3b1ee87705..8e0c222178 100644 --- a/CRM/Admin/Form/ScheduleReminders.php +++ b/CRM/Admin/Form/ScheduleReminders.php @@ -67,8 +67,7 @@ class CRM_Admin_Form_ScheduleReminders extends CRM_Admin_Form { return; } elseif ($this->_action & (CRM_Core_Action::UPDATE)) { - $this->_mappingID = - CRM_Core_DAO::getFieldValue('CRM_Core_DAO_ActionSchedule', $this->_id, 'mapping_id'); + $this->_mappingID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_ActionSchedule', $this->_id, 'mapping_id'); if ($this->_context == 'event') { $this->_compId = CRM_Utils_Request::retrieve('compId', 'Integer', $this); } diff --git a/CRM/Case/Info.php b/CRM/Case/Info.php index ce9be2e1a6..7ee506fe4a 100644 --- a/CRM/Case/Info.php +++ b/CRM/Case/Info.php @@ -199,7 +199,7 @@ class CRM_Case_Info extends CRM_Core_Component_Info { 'query' => "reset=1&action=add&atype=$atype&context=standalone", 'ref' => 'new-case', 'title' => ts('Case'), - ) + ), )); } } diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index 17d1a26f8a..941f183f35 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -189,16 +189,15 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * * @param array $params * (reference ) an assoc array of name/value pairs. - * @param int $contactId - * This is contact id for adding relationship. * @param array $ids * The array that holds all the db ids. + * @param int $contactId + * This is contact id for adding relationship. * * @return CRM_Contact_BAO_Relationship */ public static function add(&$params, $ids = array(), $contactId = NULL) { - $relationshipId = - CRM_Utils_Array::value('relationship', $ids, CRM_Utils_Array::value('id', $params)); + $relationshipId = CRM_Utils_Array::value('relationship', $ids, CRM_Utils_Array::value('id', $params)); $hook = 'create'; if ($relationshipId) { @@ -372,7 +371,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * @param array $params * (reference ) an assoc array of name/value pairs. * - * @return boolean + * @return bool */ public static function dataExists(&$params) { // return if no data present @@ -407,7 +406,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * @return array * array reference of all relationship types with context to current contact. */ - static function getContactRelationshipType( + public static function getContactRelationshipType( $contactId = NULL, $contactSuffix = NULL, $relationshipId = NULL, @@ -582,7 +581,6 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * * @param $action * - * @return null */ public static function disableEnableRelationship($id, $action) { $relationship = self::clearCurrentEmployer($id, $action); @@ -668,7 +666,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * @param int $relationshipTypeId * Relationship type id. * - * @return boolean + * @return bool * true if it is valid relationship else false */ public static function checkRelationshipType($contact_a, $contact_b, $relationshipTypeId) { @@ -739,7 +737,7 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * @param int $relationshipId * This is relationship id for the contact. * - * @return boolean + * @return bool * true if record exists else false */ public static function checkDuplicateRelationship(&$params, $id, $contactId = 0, $relationshipId = 0) { @@ -1045,7 +1043,7 @@ LEFT JOIN civicrm_country ON (civicrm_address.country_id = civicrm_country.id) * @return array|int * relationship records */ - static function getRelationship( + public static function getRelationship( $contactId = NULL, $status = 0, $numRelationship = 0, $count = 0, $relationshipId = 0, @@ -1700,7 +1698,7 @@ AND cc.sort_name LIKE '%$name%'"; * Api input array. * @param null $direction * - * @return array + * @return array|void */ public static function membershipTypeToRelationshipTypes(&$params, $direction = NULL) { $membershipType = civicrm_api3('membership_type', 'getsingle', array( @@ -1709,12 +1707,12 @@ AND cc.sort_name LIKE '%$name%'"; )); $relationshipTypes = $membershipType['relationship_type_id']; if (empty($relationshipTypes)) { - return; + return NULL; } // if we don't have any contact data we can only filter on type if (empty($params['contact_id']) && empty($params['contact_id_a']) && empty($params['contact_id_a'])) { $params['relationship_type_id'] = array('IN' => $relationshipTypes); - return; + return NULL; } else { $relationshipDirections = (array) $membershipType['relationship_direction']; diff --git a/CRM/Contact/Form/Edit/IM.php b/CRM/Contact/Form/Edit/IM.php index 755fc50335..07ba127a86 100644 --- a/CRM/Contact/Form/Edit/IM.php +++ b/CRM/Contact/Form/Edit/IM.php @@ -66,7 +66,7 @@ class CRM_Contact_Form_Edit_IM { $form->addSelect("im[$blockId][location_type_id]", array( 'entity' => 'im', 'class' => 'eight', - 'placeholder' => NULL + 'placeholder' => NULL, )); //IM box diff --git a/CRM/Contribute/Form/ContributionPage/Settings.php b/CRM/Contribute/Form/ContributionPage/Settings.php index f1e4efee12..d6c8cf2322 100644 --- a/CRM/Contribute/Form/ContributionPage/Settings.php +++ b/CRM/Contribute/Form/ContributionPage/Settings.php @@ -144,20 +144,19 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_ $coreTypes = array('Contact', 'Organization'); $entities[] = array( - 'entity_name' => array ('contact_1'), + 'entity_name' => array('contact_1'), 'entity_type' => 'OrganizationModel', ); if ($member && $member['is_active']) { $coreTypes[] = 'Membership'; $entities[] = array( - 'entity_name' => array ('membership_1'), + 'entity_name' => array('membership_1'), 'entity_type' => 'MembershipModel', ); } - - $allowCoreTypes = array_merge($coreTypes, - CRM_Contact_BAO_ContactType::subTypes('Organization')); + + $allowCoreTypes = array_merge($coreTypes, CRM_Contact_BAO_ContactType::subTypes('Organization')); $allowSubTypes = array(); $this->addProfileSelector('onbehalf_profile_id', ts('Organization Profile'), $allowCoreTypes, $allowSubTypes, $entities); @@ -207,7 +206,7 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_ 'Contact', 'Individual', 'Organization', - 'Household' + 'Household', ), CRM_Contact_BAO_ContactType::subTypes('Individual')); $allowSubTypes = array(); @@ -349,19 +348,17 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_ $dao = CRM_Contribute_BAO_ContributionPage::create($params); $ufJoinParams = array( - 'onbehalf_profile_id' => - array( - 'is_active' => 1, - 'module' => 'OnBehalf', - 'entity_table' => 'civicrm_contribution_page', - 'entity_id' => $dao->id, - ), - 'honor_block_is_active' => - array( - 'module' => 'soft_credit', - 'entity_table' => 'civicrm_contribution_page', - 'entity_id' => $dao->id, - ), + 'onbehalf_profile_id' => array( + 'is_active' => 1, + 'module' => 'OnBehalf', + 'entity_table' => 'civicrm_contribution_page', + 'entity_id' => $dao->id, + ), + 'honor_block_is_active' => array( + 'module' => 'soft_credit', + 'entity_table' => 'civicrm_contribution_page', + 'entity_id' => $dao->id, + ), ); foreach ($ufJoinParams as $index => $ufJoinParam) { diff --git a/CRM/Contribute/Import/Form/DataSource.php b/CRM/Contribute/Import/Form/DataSource.php index fe1ece4e0c..714ef886ac 100644 --- a/CRM/Contribute/Import/Form/DataSource.php +++ b/CRM/Contribute/Import/Form/DataSource.php @@ -68,7 +68,7 @@ class CRM_Contribute_Import_Form_DataSource extends CRM_Core_Form { $this->setMaxFileSize($uploadFileSize); $this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array( 1 => $uploadSize, - 2 => $uploadFileSize + 2 => $uploadFileSize, )), 'maxfilesize', $uploadFileSize); $this->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile'); $this->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File'); diff --git a/CRM/Core/BAO/MailSettings.php b/CRM/Core/BAO/MailSettings.php index 692a08dd75..f3bf998eac 100644 --- a/CRM/Core/BAO/MailSettings.php +++ b/CRM/Core/BAO/MailSettings.php @@ -54,7 +54,7 @@ class CRM_Core_BAO_MailSettings extends CRM_Core_DAO_MailSettings { static $mailSettings = array(); $domainID = CRM_Core_Config::domainID(); if (empty($mailSettings[$domainID]) || $reset) { - $dao = new self; + $dao = new self(); $dao->is_default = 1; $dao->domain_id = $domainID; $dao->find(TRUE); @@ -96,7 +96,7 @@ class CRM_Core_BAO_MailSettings extends CRM_Core_DAO_MailSettings { /** * Return the "include message ID" flag from the default set of settings. * - * @return boolean + * @return bool * default include message ID */ public static function includeMessageId() { diff --git a/CRM/Core/I18n/SchemaStructure_3_0_alpha1.php b/CRM/Core/I18n/SchemaStructure_3_0_alpha1.php index 60923ce4a0..cb87967126 100644 --- a/CRM/Core/I18n/SchemaStructure_3_0_alpha1.php +++ b/CRM/Core/I18n/SchemaStructure_3_0_alpha1.php @@ -238,9 +238,9 @@ class CRM_Core_I18n_SchemaStructure_3_0_alpha1 { } /** - * @return array + * @return array $result */ - static function &tables() { + public static function &tables() { static $result = NULL; if (!$result) { $result = array_keys(self::columns()); diff --git a/CRM/Core/Payment/eWAY.php b/CRM/Core/Payment/eWAY.php index ee118d5317..39bf81aa27 100644 --- a/CRM/Core/Payment/eWAY.php +++ b/CRM/Core/Payment/eWAY.php @@ -89,7 +89,7 @@ * ie - all other amounts will return a failed response. * * ----------------------------------------------------------------------------------------------- - **/ + */ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { # (not used, implicit in the API, might need to convert?) const CHARSET = 'UTF-8'; @@ -102,15 +102,16 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { */ static private $_singleton = NULL; - /********************************************************** + /** + * ******************************************************* * Constructor * * @param string $mode * The mode of operation: live or test. * - * @param $paymentProcessor + * @param int $paymentProcessor * - * @return \CRM_Core_Payment_eWAY ******************************************************* + * ******************************************************* */ public function __construct($mode, &$paymentProcessor) { // require Standard eWAY API libraries @@ -123,10 +124,12 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { $this->_processorName = ts('eWay'); } - /********************************************************** + /** + * ******************************************************* * This function sends request and receives response from * eWAY payment process - **********************************************************/ + * ******************************************************* + */ public function doDirectPayment(&$params) { if (CRM_Utils_Array::value('is_recur', $params) == TRUE) { CRM_Core_Error::fatal(ts('eWAY - recurring payments not implemented')); @@ -144,13 +147,13 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { //------------------------------------ // create eWAY gateway objects //------------------------------------ - $eWAYRequest = new GatewayRequest; + $eWAYRequest = new GatewayRequest(); if (($eWAYRequest == NULL) || (!($eWAYRequest instanceof GatewayRequest))) { return self::errorExit(9001, "Error: Unable to create eWAY Request object."); } - $eWAYResponse = new GatewayResponse; + $eWAYResponse = new GatewayResponse(); if (($eWAYResponse == NULL) || (!($eWAYResponse instanceof GatewayResponse))) { return self::errorExit(9002, "Error: Unable to create eWAY Response object."); @@ -420,9 +423,11 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { return $contribution->find(); } - /************************************************************************************************* + /** + * ********************************************************************************************** * This function checks the eWAY response status - returning a boolean false if status != 'true' - *************************************************************************************************/ + * ************************************************************************************************ + */ public function isError(&$response) { $status = $response->Status(); @@ -432,9 +437,11 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { return FALSE; } - /************************************************** + /** + * ************************************************ * Produces error message and returns from class - **************************************************/ + * ************************************************* + */ public function &errorExit($errorCode = NULL, $errorMessage = NULL) { $e = CRM_Core_Error::singleton(); @@ -447,14 +454,17 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { return $e; } - /************************************************** + /** + * ************************************************ * NOTE: 'doTransferCheckout' not implemented - **************************************************/ + * ************************************************ + */ public function doTransferCheckout(&$params, $component) { CRM_Core_Error::fatal(ts('This function is not implemented')); } - /******************************************************************************************** + /** + * ***************************************************************************************** * This public function checks to see if we have the right processor config values set * * NOTE: Called by Events and Contribute to check config params are set prior to trying @@ -467,10 +477,8 @@ class CRM_Core_Payment_eWAY extends CRM_Core_Payment { * * returns string $errorMsg if any errors found - null if OK * - ****************************************************************************************** + * ***************************************************************************************** */ - //function checkConfig( $mode ) // CiviCRM V1.9 Declaration - // CiviCRM V2.0 Declaration public function checkConfig() { $errorMsg = array(); diff --git a/CRM/Core/Permission/DrupalBase.php b/CRM/Core/Permission/DrupalBase.php index 18dfbff834..a63815eb82 100644 --- a/CRM/Core/Permission/DrupalBase.php +++ b/CRM/Core/Permission/DrupalBase.php @@ -259,7 +259,7 @@ class CRM_Core_Permission_DrupalBase extends CRM_Core_Permission_Base { * @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/Permission/Joomla.php b/CRM/Core/Permission/Joomla.php index 7110b890ff..9ae05208dc 100644 --- a/CRM/Core/Permission/Joomla.php +++ b/CRM/Core/Permission/Joomla.php @@ -43,7 +43,7 @@ class CRM_Core_Permission_Joomla extends CRM_Core_Permission_Base { * @param string $str * The permission to check. * - * @return boolean + * @return bool * true if yes, else false */ public function check($str) { @@ -104,7 +104,7 @@ class CRM_Core_Permission_Joomla extends CRM_Core_Permission_Base { * @param array $array * The roles to check. * - * @return boolean + * @return bool * true if yes, else false */ public function checkGroupRole($array) { diff --git a/CRM/Custom/Import/Form/DataSource.php b/CRM/Custom/Import/Form/DataSource.php index 64c9c7564f..250cf170c8 100644 --- a/CRM/Custom/Import/Form/DataSource.php +++ b/CRM/Custom/Import/Form/DataSource.php @@ -97,7 +97,7 @@ class CRM_Custom_Import_Form_DataSource extends CRM_Core_Form { $this->setMaxFileSize($uploadFileSize); $this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array( 1 => $uploadSize, - 2 => $uploadFileSize + 2 => $uploadFileSize, )), 'maxfilesize', $uploadFileSize); $this->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile'); $this->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File'); diff --git a/CRM/Dedupe/Merger.php b/CRM/Dedupe/Merger.php index 1e208b170e..17daf65be2 100644 --- a/CRM/Dedupe/Merger.php +++ b/CRM/Dedupe/Merger.php @@ -563,7 +563,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * Helps decide how to behave when there are conflicts. * A 'safe' value skips the merge if there are any un-resolved conflicts. * Does a force merge otherwise. - * @param bool $autoFlipWether to let api decide which contact to retain and which to delete. + * @param bool $autoFlip to let api decide which contact to retain and which to delete. * Wether to let api decide which contact to retain and which to delete. * @param bool $redirectForPerformance * @@ -608,7 +608,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m * Helps decide how to behave when there are conflicts. * A 'safe' value skips the merge if there are any un-resolved conflicts. * Does a force merge otherwise (aggressive mode). - * @param bool $autoFlipWether to let api decide which contact to retain and which to delete. + * @param bool $autoFlip to let api decide which contact to retain and which to delete. * Wether to let api decide which contact to retain and which to delete. * * @@ -823,7 +823,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m $params = array( 'contact_id' => $cid, 'version' => 3, - 'return' => array_merge(array('display_name'), self::getContactFields()) + 'return' => array_merge(array('display_name'), self::getContactFields()), ); $result = civicrm_api('contact', 'get', $params); @@ -855,11 +855,10 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m $specialValues[$moniker]['preferred_communication_method'] = CRM_Core_DAO::VALUE_SEPARATOR . $prefCommList . CRM_Core_DAO::VALUE_SEPARATOR; } $names = array( - 'preferred_communication_method' => - array( - 'newName' => 'preferred_communication_method_display', - 'groupName' => 'preferred_communication_method', - ), + 'preferred_communication_method' => array( + 'newName' => 'preferred_communication_method_display', + 'groupName' => 'preferred_communication_method', + ), ); CRM_Core_OptionGroup::lookupValues($specialValues[$moniker], $names); @@ -1430,7 +1429,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m if (in_array($htmlType, array( 'CheckBox', 'Multi-Select', - 'AdvMulti-Select' + 'AdvMulti-Select', ))) { $submitted[$key] = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR, $mergeValue @@ -1443,7 +1442,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m } elseif (in_array($htmlType, array( 'Multi-Select Country', - 'Multi-Select State/Province' + 'Multi-Select State/Province', ))) { //we require submitted values should be in array format if ($value) { @@ -1617,7 +1616,7 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m 'modified_date', 'primary_contact_id', 'sort_name', - 'user_unique_id' + 'user_unique_id', ); foreach ($contactFields as $field => $value) { if (in_array($field, $invalidFields)) { @@ -1629,10 +1628,10 @@ INNER JOIN civicrm_membership membership2 ON membership1.membership_type_id = m /** * Added for CRM-12695 - * Based on the contactId provided + * Based on the contactID provided * add/update membership(s) to related contacts * - * @param contactId + * @param int $contactID */ public static function addMembershipToRealtedContacts($contactID) { $dao = new CRM_Member_DAO_Membership(); diff --git a/CRM/Event/Page/Tab.php b/CRM/Event/Page/Tab.php index 1cc1f3f996..861598ad95 100644 --- a/CRM/Event/Page/Tab.php +++ b/CRM/Event/Page/Tab.php @@ -39,8 +39,6 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { /** * called when action is browse - * - * @return null */ public function browse() { $controller = new CRM_Core_Controller_Simple( @@ -283,8 +281,6 @@ class CRM_Event_Page_Tab extends CRM_Core_Page { /** * used for the to show the associated * contribution for the participant - * - * @return null */ public function associatedContribution() { if (CRM_Core_Permission::access('CiviContribute')) { diff --git a/CRM/Financial/Page/AJAX.php b/CRM/Financial/Page/AJAX.php index 6832c9afd8..6e4bd6abb6 100644 --- a/CRM/Financial/Page/AJAX.php +++ b/CRM/Financial/Page/AJAX.php @@ -85,9 +85,9 @@ class CRM_Financial_Page_AJAX { $selectedArray['selected'] = 'Selected'; } $elements[] = array( - 'name' => $name, - 'value' => $id, - ) + $selectedArray; + 'name' => $name, + 'value' => $id, + ) + $selectedArray; } } CRM_Utils_JSON::output($elements); @@ -261,18 +261,17 @@ class CRM_Financial_Page_AJAX { } public static function getFinancialTransactionsList() { - $sortMapper = - array( - 0 => '', - 1 => '', - 2 => 'sort_name', - 3 => 'amount', - 4 => 'trxn_id', - 5 => 'transaction_date', - 6 => 'payment_method', - 7 => 'status', - 8 => 'name', - ); + $sortMapper = array( + 0 => '', + 1 => '', + 2 => 'sort_name', + 3 => 'amount', + 4 => 'trxn_id', + 5 => 'transaction_date', + 6 => 'payment_method', + 7 => 'status', + 8 => 'name', + ); $sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer'); $offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0; @@ -290,34 +289,32 @@ class CRM_Financial_Page_AJAX { $params['sortBy'] = $sort . ' ' . $sortOrder; } - $returnvalues = - array( - 'civicrm_financial_trxn.payment_instrument_id as payment_method', - 'civicrm_contribution.contact_id as contact_id', - 'civicrm_contribution.id as contributionID', - 'contact_a.sort_name', - 'civicrm_financial_trxn.total_amount as amount', - 'civicrm_financial_trxn.trxn_id as trxn_id', - 'contact_a.contact_type', - 'contact_a.contact_sub_type', - 'civicrm_financial_trxn.trxn_date as transaction_date', - 'name', - 'civicrm_contribution.currency as currency', - 'civicrm_financial_trxn.status_id as status', - 'civicrm_financial_trxn.check_number as check_number', - ); + $returnvalues = array( + 'civicrm_financial_trxn.payment_instrument_id as payment_method', + 'civicrm_contribution.contact_id as contact_id', + 'civicrm_contribution.id as contributionID', + 'contact_a.sort_name', + 'civicrm_financial_trxn.total_amount as amount', + 'civicrm_financial_trxn.trxn_id as trxn_id', + 'contact_a.contact_type', + 'contact_a.contact_sub_type', + 'civicrm_financial_trxn.trxn_date as transaction_date', + 'name', + 'civicrm_contribution.currency as currency', + 'civicrm_financial_trxn.status_id as status', + 'civicrm_financial_trxn.check_number as check_number', + ); - $columnHeader = - array( - 'contact_type' => '', - 'sort_name' => ts('Contact Name'), - 'amount' => ts('Amount'), - 'trxn_id' => ts('Trxn ID'), - 'transaction_date' => ts('Received'), - 'payment_method' => ts('Payment Method'), - 'status' => ts('Status'), - 'name' => ts('Type'), - ); + $columnHeader = array( + 'contact_type' => '', + 'sort_name' => ts('Contact Name'), + 'amount' => ts('Amount'), + 'trxn_id' => ts('Trxn ID'), + 'transaction_date' => ts('Received'), + 'payment_method' => ts('Payment Method'), + 'status' => ts('Status'), + 'name' => ts('Type'), + ); if ($sort && $sortOrder) { $params['sortBy'] = $sort . ' ' . $sortOrder; @@ -450,19 +447,18 @@ class CRM_Financial_Page_AJAX { } $iFilteredTotal = $iTotal = $params['total']; - $selectorElements = - array( - 'check', - 'contact_type', - 'sort_name', - 'amount', - 'trxn_id', - 'transaction_date', - 'payment_method', - 'status', - 'name', - 'action', - ); + $selectorElements = array( + 'check', + 'contact_type', + 'sort_name', + 'amount', + 'trxn_id', + 'transaction_date', + 'payment_method', + 'status', + 'name', + 'action', + ); echo CRM_Utils_JSON::encodeDataTableSelector($financialitems, $sEcho, $iTotal, $iFilteredTotal, $selectorElements); CRM_Utils_System::civiExit(); @@ -484,12 +480,11 @@ class CRM_Financial_Page_AJAX { foreach ($cIDs as $key => $value) { $recordPID = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialTrxn', $value, 'payment_instrument_id'); if ($action == 'Remove' || ($recordPID == $batchPID && $action == 'Assign') || !isset($batchPID)) { - $params = - array( - 'entity_id' => $value, - 'entity_table' => 'civicrm_financial_trxn', - 'batch_id' => $entityID, - ); + $params = array( + 'entity_id' => $value, + 'entity_table' => 'civicrm_financial_trxn', + 'batch_id' => $entityID, + ); if ($action == 'Assign') { $updated = CRM_Batch_BAO_Batch::addBatchEntity($params); } @@ -512,18 +507,17 @@ class CRM_Financial_Page_AJAX { $params = array('id' => $batchID); $batchInfo = CRM_Batch_BAO_Batch::retrieve($params, $value); $batchTotals = CRM_Batch_BAO_Batch::batchTotals(array($batchID)); - $batchSummary = - array( - 'created_by' => CRM_Contact_BAO_Contact::displayName($batchInfo->created_id), - 'status' => CRM_Core_OptionGroup::getLabel('batch_status', $batchInfo->status_id), - 'description' => $batchInfo->description, - 'payment_instrument' => CRM_Core_OptionGroup::getLabel('payment_instrument', $batchInfo->payment_instrument_id), - 'item_count' => $batchInfo->item_count, - 'assigned_item_count' => $batchTotals[$batchID]['item_count'], - 'total' => CRM_Utils_Money::format($batchInfo->total), - 'assigned_total' => CRM_Utils_Money::format($batchTotals[$batchID]['total']), - 'opened_date' => CRM_Utils_Date::customFormat($batchInfo->created_date), - ); + $batchSummary = array( + 'created_by' => CRM_Contact_BAO_Contact::displayName($batchInfo->created_id), + 'status' => CRM_Core_OptionGroup::getLabel('batch_status', $batchInfo->status_id), + 'description' => $batchInfo->description, + 'payment_instrument' => CRM_Core_OptionGroup::getLabel('payment_instrument', $batchInfo->payment_instrument_id), + 'item_count' => $batchInfo->item_count, + 'assigned_item_count' => $batchTotals[$batchID]['item_count'], + 'total' => CRM_Utils_Money::format($batchInfo->total), + 'assigned_total' => CRM_Utils_Money::format($batchTotals[$batchID]['total']), + 'opened_date' => CRM_Utils_Date::customFormat($batchInfo->created_date), + ); CRM_Utils_JSON::output($batchSummary); } diff --git a/CRM/Grant/Form/Task/Delete.php b/CRM/Grant/Form/Task/Delete.php index 30f55d2d99..6ac833fa80 100644 --- a/CRM/Grant/Form/Task/Delete.php +++ b/CRM/Grant/Form/Task/Delete.php @@ -53,7 +53,7 @@ class CRM_Grant_Form_Task_Delete extends CRM_Grant_Form_Task { * * @return void */ - function preProcess() { + public function preProcess() { parent::preProcess(); //check permission for delete. diff --git a/CRM/Mailing/Form/Unsubscribe.php b/CRM/Mailing/Form/Unsubscribe.php index 876aa3ab52..991b4d2dd9 100644 --- a/CRM/Mailing/Form/Unsubscribe.php +++ b/CRM/Mailing/Form/Unsubscribe.php @@ -103,13 +103,10 @@ class CRM_Mailing_Form_Unsubscribe extends CRM_Core_Form { } public function postProcess() { - $values = $this->exportValues(); // check if EmailTyped matches Email address $result = CRM_Utils_String::compareStr($this->_email, $values['email_confirm'], TRUE); - - $job_id = $this->_job_id; $queue_id = $this->_queue_id; $hash = $this->_hash; diff --git a/CRM/Pledge/Form/Task/Delete.php b/CRM/Pledge/Form/Task/Delete.php index a33008b6f8..9d36ada167 100644 --- a/CRM/Pledge/Form/Task/Delete.php +++ b/CRM/Pledge/Form/Task/Delete.php @@ -50,10 +50,8 @@ class CRM_Pledge_Form_Task_Delete extends CRM_Pledge_Form_Task { /** * Build all the data structures needed to build the form - * - * @return void */ - function preProcess() { + public function preProcess() { //check for delete if (!CRM_Core_Permission::checkActionPermission('CiviPledge', CRM_Core_Action::DELETE)) { CRM_Core_Error::fatal(ts('You do not have permission to access this page.')); @@ -87,7 +85,7 @@ class CRM_Pledge_Form_Task_Delete extends CRM_Pledge_Form_Task { $status = ts('Deleted Pledge(s): %1 (Total Selected: %2) ', array( 1 => $deletedPledges, - 2 => count($this->_pledgeIds) + 2 => count($this->_pledgeIds), )); CRM_Core_Session::setStatus($status, '', 'info'); } diff --git a/CRM/Pledge/Info.php b/CRM/Pledge/Info.php index 8f5f3c2db5..e3eee49aa7 100644 --- a/CRM/Pledge/Info.php +++ b/CRM/Pledge/Info.php @@ -180,7 +180,7 @@ class CRM_Pledge_Info extends CRM_Core_Component_Info { 'query' => 'reset=1&action=add&context=standalone', 'ref' => 'new-pledge', 'title' => ts('Pledge'), - ) + ), )); } } diff --git a/CRM/Profile/Selector/Listings.php b/CRM/Profile/Selector/Listings.php index 2816bf2260..9a48e63a7b 100644 --- a/CRM/Profile/Selector/Listings.php +++ b/CRM/Profile/Selector/Listings.php @@ -129,17 +129,16 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR /** * Class constructor * - * @param array $params - * @param $customFields - * @param string params the params for the where clause - * + * @param array $params the params for the where clause + * @param array $customFields + * @param array $ufGroupIds * @param bool $map * @param bool $editLink * @param bool $linkToUF * * @return \CRM_Profile_Selector_Listings */ - function __construct( + public function __construct( &$params, &$customFields, $ufGroupIds = NULL, @@ -274,8 +273,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR * @param array $params */ public function getPagerParams($action, &$params) { - $status = - CRM_Utils_System::isNull($this->_multiRecordTableName) ? ts('Contact %%StatusMessage%%') : ts('Contact Multi Records %%StatusMessage%%'); + $status = CRM_Utils_System::isNull($this->_multiRecordTableName) ? ts('Contact %%StatusMessage%%') : ts('Contact Multi Records %%StatusMessage%%'); $params['status'] = $status; $params['csvString'] = NULL; $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT; @@ -341,7 +339,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR if (in_array($fieldName, array( 'phone', 'im', - 'email' + 'email', ))) { if ($type) { $name = "`$locationTypeName-$fieldName-$type`"; @@ -552,7 +550,7 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR if (in_array($fieldName, array( 'phone', 'im', - 'email' + 'email', ))) { if ($type) { $names[] = "{$locationTypeName}-{$fieldName}-{$type}"; @@ -665,14 +663,14 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR elseif (in_array($name, array( 'addressee', 'email_greeting', - 'postal_greeting' + 'postal_greeting', ))) { $dname = $name . '_display'; $row[] = $result->$dname; } elseif (in_array($name, array( 'birth_date', - 'deceased_date' + 'deceased_date', ))) { $row[] = CRM_Utils_Date::customFormat($result->$name); } @@ -771,10 +769,10 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR } if ($isSubmitted) { - $this->_multiRecordTableName = $multiRecordTableName = - CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $customGroupId, 'table_name'); + $this->_multiRecordTableName + = $multiRecordTableName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $customGroupId, 'table_name'); if ($multiRecordTableName) { - return; + return NULL; } } @@ -786,14 +784,14 @@ class CRM_Profile_Selector_Listings extends CRM_Core_Selector_Base implements CR } if (!isset($customGroupId) || !$customGroupId) { - return; + return NULL; } //if the field is in selector and not a searchable field //get the proper customvalue table name if ($selectorSet) { - $this->_multiRecordTableName = $multiRecordTableName = - CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $customGroupId, 'table_name'); + $this->_multiRecordTableName + = $multiRecordTableName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $customGroupId, 'table_name'); } } //func close } diff --git a/CRM/Report/Form/Contribute/History.php b/CRM/Report/Form/Contribute/History.php index 9ae238833f..686e0d92e7 100644 --- a/CRM/Report/Form/Contribute/History.php +++ b/CRM/Report/Form/Contribute/History.php @@ -80,131 +80,131 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { } $this->_columns = array( - 'civicrm_contact' => array( - 'dao' => 'CRM_Contact_DAO_Contact', - 'fields' => array( - 'sort_name' => array( - 'title' => ts('Contact Name'), - 'default' => TRUE, - 'required' => TRUE, - 'no_repeat' => TRUE, - ), - 'id' => array( - 'no_display' => TRUE, - 'default' => TRUE, - 'required' => TRUE, - ), - 'contact_type' => array( - 'title' => ts('Contact Type'), - ), - 'contact_sub_type' => array( - 'title' => ts('Contact Subtype'), - ), + 'civicrm_contact' => array( + 'dao' => 'CRM_Contact_DAO_Contact', + 'fields' => array( + 'sort_name' => array( + 'title' => ts('Contact Name'), + 'default' => TRUE, + 'required' => TRUE, + 'no_repeat' => TRUE, ), - 'grouping' => 'contact-fields', - 'filters' => array( - 'sort_name' => array('title' => ts('Contact Name')), - 'id' => array( - 'title' => ts('Contact ID'), - 'no_display' => TRUE, - ), + 'id' => array( + 'no_display' => TRUE, + 'default' => TRUE, + 'required' => TRUE, + ), + 'contact_type' => array( + 'title' => ts('Contact Type'), + ), + 'contact_sub_type' => array( + 'title' => ts('Contact Subtype'), ), ), - 'civicrm_email' => array( - 'dao' => 'CRM_Core_DAO_Email', - 'fields' => array( - 'email' => array( - 'title' => ts('Email'), - 'no_repeat' => TRUE, - ), + 'grouping' => 'contact-fields', + 'filters' => array( + 'sort_name' => array('title' => ts('Contact Name')), + '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('Phone'), - 'no_repeat' => TRUE, - ), + ), + 'civicrm_email' => array( + 'dao' => 'CRM_Core_DAO_Email', + 'fields' => array( + 'email' => array( + 'title' => ts('Email'), + 'no_repeat' => TRUE, ), - 'grouping' => 'contact-fields', ), - ) + $this->addAddressFields(FALSE, FALSE, FALSE, array()) + array( - 'civicrm_relationship' => array( - 'dao' => 'CRM_Contact_DAO_Relationship', - 'fields' => array( - 'relationship_type_id' => array( - 'title' => ts('Relationship Type'), - 'default' => TRUE, - ), - 'contact_id_a' => array('no_display' => TRUE), - 'contact_id_b' => array('no_display' => TRUE), + 'grouping' => 'contact-fields', + ), + 'civicrm_phone' => array( + 'dao' => 'CRM_Core_DAO_Phone', + 'fields' => array( + 'phone' => array( + 'title' => ts('Phone'), + 'no_repeat' => TRUE, ), - 'filters' => array( - 'relationship_type_id' => array( - 'title' => ts('Relationship Type'), - 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'options' => $relationTypeOp, - 'type' => CRM_Utils_Type::T_STRING, - ), + ), + 'grouping' => 'contact-fields', + ), + ) + $this->addAddressFields(FALSE, FALSE, FALSE, array()) + array( + 'civicrm_relationship' => array( + 'dao' => 'CRM_Contact_DAO_Relationship', + 'fields' => array( + 'relationship_type_id' => array( + 'title' => ts('Relationship Type'), + 'default' => TRUE, ), + 'contact_id_a' => array('no_display' => TRUE), + 'contact_id_b' => array('no_display' => TRUE), ), - ) + array( - 'civicrm_contribution' => array( - 'dao' => 'CRM_Contribute_DAO_Contribution', - 'fields' => array( - 'total_amount' => array( - 'title' => ts('Amount Statistics'), - 'default' => TRUE, - 'required' => TRUE, - 'no_display' => TRUE, - 'statistics' => array('sum' => ts('Aggregate Amount')), - ), - 'receive_date' => array( - 'required' => TRUE, - 'default' => TRUE, - 'no_display' => TRUE, - ), + 'filters' => array( + 'relationship_type_id' => array( + 'title' => ts('Relationship Type'), + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'options' => $relationTypeOp, + 'type' => CRM_Utils_Type::T_STRING, ), - 'grouping' => 'contri-fields', - 'filters' => array( - 'this_year' => array( - 'title' => ts('This Year'), - 'operatorType' => CRM_Report_Form::OP_SELECT, - 'options' => $optionYear, - 'default' => '', - ), - 'other_year' => array( - 'title' => ts('Other Years'), - 'operatorType' => CRM_Report_Form::OP_SELECT, - 'options' => $optionYear, - 'default' => '', - ), - 'receive_date' => array('operatorType' => CRM_Report_Form::OP_DATE), - 'contribution_status_id' => array( - 'title' => ts('Contribution Status'), - 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'options' => CRM_Contribute_PseudoConstant::contributionStatus(), - 'default' => array(1), - ), - 'financial_type_id' => array( - 'title' => ts('Financial Type'), - 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'options' => CRM_Contribute_PseudoConstant::financialType(), - ), - 'total_amount' => array( - 'title' => ts('Contribution Amount'), - ), - 'total_sum' => array( - 'title' => ts('Aggregate Amount'), - 'type' => CRM_Report_Form::OP_INT, - 'dbAlias' => 'civicrm_contribution_total_amount_sum', - 'having' => TRUE, - ), + ), + ), + ) + array( + 'civicrm_contribution' => array( + 'dao' => 'CRM_Contribute_DAO_Contribution', + 'fields' => array( + 'total_amount' => array( + 'title' => ts('Amount Statistics'), + 'default' => TRUE, + 'required' => TRUE, + 'no_display' => TRUE, + 'statistics' => array('sum' => ts('Aggregate Amount')), + ), + 'receive_date' => array( + 'required' => TRUE, + 'default' => TRUE, + 'no_display' => TRUE, ), ), - ); + 'grouping' => 'contri-fields', + 'filters' => array( + 'this_year' => array( + 'title' => ts('This Year'), + 'operatorType' => CRM_Report_Form::OP_SELECT, + 'options' => $optionYear, + 'default' => '', + ), + 'other_year' => array( + 'title' => ts('Other Years'), + 'operatorType' => CRM_Report_Form::OP_SELECT, + 'options' => $optionYear, + 'default' => '', + ), + 'receive_date' => array('operatorType' => CRM_Report_Form::OP_DATE), + 'contribution_status_id' => array( + 'title' => ts('Contribution Status'), + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'options' => CRM_Contribute_PseudoConstant::contributionStatus(), + 'default' => array(1), + ), + 'financial_type_id' => array( + 'title' => ts('Financial Type'), + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'options' => CRM_Contribute_PseudoConstant::financialType(), + ), + 'total_amount' => array( + 'title' => ts('Contribution Amount'), + ), + 'total_sum' => array( + 'title' => ts('Aggregate Amount'), + 'type' => CRM_Report_Form::OP_INT, + 'dbAlias' => 'civicrm_contribution_total_amount_sum', + 'having' => TRUE, + ), + ), + ), + ); $this->_columns['civicrm_contribution']['fields']['civicrm_upto_' . $this->_yearStatisticsFrom] = array( @@ -623,8 +623,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { return $rows; } - $sqlContribution = - "{$this->_select} {$this->_from} WHERE {$this->_aliases['civicrm_contact']}.id IN (" . + $sqlContribution = "{$this->_select} {$this->_from} WHERE {$this->_aliases['civicrm_contact']}.id IN (" . implode(',', $contactIds) . ") AND {$this->_aliases['civicrm_contribution']}.is_test = 0 {$this->_statusClause} {$this->_groupBy} "; @@ -681,8 +680,7 @@ class CRM_Report_Form_Contribute_History extends CRM_Report_Form { if (!empty($this->_relationshipColumns)) { $addRelSelect = ', ' . implode(', ', $this->_relationshipColumns); } - $sqlRelationship = - "SELECT {$this->_aliases['civicrm_relationship']}.relationship_type_id as relationship_type_id, {$this->_aliases['civicrm_relationship']}.contact_id_a as contact_id_a, {$this->_aliases['civicrm_relationship']}.contact_id_b as contact_id_b {$addRelSelect} FROM civicrm_contact {$relContactAlias} {$this->_relationshipFrom} WHERE {$relContactAlias}.id IN (" . + $sqlRelationship = "SELECT {$this->_aliases['civicrm_relationship']}.relationship_type_id as relationship_type_id, {$this->_aliases['civicrm_relationship']}.contact_id_a as contact_id_a, {$this->_aliases['civicrm_relationship']}.contact_id_b as contact_id_b {$addRelSelect} FROM civicrm_contact {$relContactAlias} {$this->_relationshipFrom} WHERE {$relContactAlias}.id IN (" . implode(',', $contactIds) . ") AND {$this->_aliases['civicrm_relationship']}.is_active = 1 {$this->_relationshipWhere} GROUP BY {$this->_aliases['civicrm_relationship']}.contact_id_a, {$this->_aliases['civicrm_relationship']}.contact_id_b"; $relationshipTypes = CRM_Core_PseudoConstant::relationshipType(); diff --git a/CRM/Report/Form/Pledge/Summary.php b/CRM/Report/Form/Pledge/Summary.php index a4a9ff3920..59e091b35d 100644 --- a/CRM/Report/Form/Pledge/Summary.php +++ b/CRM/Report/Form/Pledge/Summary.php @@ -47,127 +47,127 @@ class CRM_Report_Form_Pledge_Summary extends CRM_Report_Form { */ public function __construct() { $this->_columns = array( - 'civicrm_contact' => array( - 'dao' => 'CRM_Contact_DAO_Contact', - 'fields' => array( - 'sort_name' => array( - 'title' => ts('Contact Name'), - 'no_repeat' => TRUE, - ), - 'postal_greeting_display' => array('title' => ts('Postal Greeting')), - 'id' => array( - 'no_display' => TRUE, - 'required' => TRUE, - ), + 'civicrm_contact' => array( + 'dao' => 'CRM_Contact_DAO_Contact', + 'fields' => array( + 'sort_name' => array( + 'title' => ts('Contact Name'), + 'no_repeat' => TRUE, ), - 'grouping' => 'contact-fields', - 'group_bys' => array( - 'id' => array('title' => ts('Contact ID')), - 'sort_name' => array( - 'title' => ts('Contact Name'), - ), + 'postal_greeting_display' => array('title' => ts('Postal Greeting')), + 'id' => array( + 'no_display' => TRUE, + 'required' => TRUE, ), ), - 'civicrm_email' => array( - 'dao' => 'CRM_Core_DAO_Email', - 'fields' => array( - 'email' => array( - 'no_repeat' => TRUE, - 'title' => ts('email'), - ), + 'grouping' => 'contact-fields', + 'group_bys' => array( + 'id' => array('title' => ts('Contact ID')), + 'sort_name' => array( + 'title' => ts('Contact Name'), ), - 'grouping' => 'contact-fields', ), - 'civicrm_pledge' => array( - 'dao' => 'CRM_Pledge_DAO_Pledge', - 'fields' => array( - 'id' => array( - 'no_display' => TRUE, - 'required' => FALSE, - ), - 'currency' => array( - 'required' => TRUE, - 'no_display' => TRUE, - ), - 'amount' => array( - 'title' => ts('Pledge Amount'), - 'required' => TRUE, - 'type' => CRM_Utils_Type::T_MONEY, - 'statistics' => array( - 'sum' => ts('Aggregate Amount Pledged'), - 'count' => ts('Pledges'), - 'avg' => ts('Average'), - ), - ), - 'frequency_unit' => array( - 'title' => ts('Frequency Unit'), - ), - 'installments' => array( - 'title' => ts('Installments'), - ), - 'pledge_create_date' => array( - 'title' => ts('Pledge Made Date'), - ), - 'start_date' => array( - 'title' => ts('Pledge Start Date'), - 'type' => CRM_Utils_Type::T_DATE, - ), - 'end_date' => array( - 'title' => ts('Pledge End Date'), - 'type' => CRM_Utils_Type::T_DATE, - ), - 'status_id' => array( - 'title' => ts('Pledge Status'), - ), + ), + 'civicrm_email' => array( + 'dao' => 'CRM_Core_DAO_Email', + 'fields' => array( + 'email' => array( + 'no_repeat' => TRUE, + 'title' => ts('email'), ), - 'filters' => array( - 'pledge_create_date' => array( - 'title' => 'Pledge Made Date', - 'operatorType' => CRM_Report_Form::OP_DATE, - ), - 'pledge_amount' => array( - 'title' => ts('Pledged Amount'), - 'operatorType' => CRM_Report_Form::OP_INT, - ), - '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, - ), - 'sid' => array( - 'name' => 'status_id', - 'title' => ts('Pledge Status'), - 'operatorType' => CRM_Report_Form::OP_MULTISELECT, - 'options' => CRM_Core_OptionGroup::values('contribution_status'), - ), + ), + 'grouping' => 'contact-fields', + ), + 'civicrm_pledge' => array( + 'dao' => 'CRM_Pledge_DAO_Pledge', + 'fields' => array( + 'id' => array( + 'no_display' => TRUE, + 'required' => FALSE, ), - 'group_bys' => array( - 'pledge_create_date' => array( - 'frequency' => TRUE, - 'default' => TRUE, - 'chart' => TRUE, - ), - 'frequency_unit' => array( - 'title' => ts('Frequency Unit'), - ), - 'status_id' => array( - 'title' => ts('Pledge Status'), + 'currency' => array( + 'required' => TRUE, + 'no_display' => TRUE, + ), + 'amount' => array( + 'title' => ts('Pledge Amount'), + 'required' => TRUE, + 'type' => CRM_Utils_Type::T_MONEY, + 'statistics' => array( + 'sum' => ts('Aggregate Amount Pledged'), + 'count' => ts('Pledges'), + 'avg' => ts('Average'), ), ), + 'frequency_unit' => array( + 'title' => ts('Frequency Unit'), + ), + 'installments' => array( + 'title' => ts('Installments'), + ), + 'pledge_create_date' => array( + 'title' => ts('Pledge Made Date'), + ), + 'start_date' => array( + 'title' => ts('Pledge Start Date'), + 'type' => CRM_Utils_Type::T_DATE, + ), + 'end_date' => array( + 'title' => ts('Pledge End Date'), + 'type' => CRM_Utils_Type::T_DATE, + ), + 'status_id' => array( + 'title' => ts('Pledge Status'), + ), ), - 'civicrm_pledge_payment' => array( - 'dao' => 'CRM_Pledge_DAO_PledgePayment', - 'fields' => array( - 'total_paid' => array( - 'title' => ts('Total Amount Paid'), - 'type' => CRM_Utils_Type::T_STRING, - 'dbAlias' => 'sum(pledge_payment_civireport.actual_amount)', - ), + 'filters' => array( + 'pledge_create_date' => array( + 'title' => 'Pledge Made Date', + 'operatorType' => CRM_Report_Form::OP_DATE, + ), + 'pledge_amount' => array( + 'title' => ts('Pledged Amount'), + 'operatorType' => CRM_Report_Form::OP_INT, + ), + '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, + ), + 'sid' => array( + 'name' => 'status_id', + 'title' => ts('Pledge Status'), + 'operatorType' => CRM_Report_Form::OP_MULTISELECT, + 'options' => CRM_Core_OptionGroup::values('contribution_status'), + ), + ), + 'group_bys' => array( + 'pledge_create_date' => array( + 'frequency' => TRUE, + 'default' => TRUE, + 'chart' => TRUE, + ), + 'frequency_unit' => array( + 'title' => ts('Frequency Unit'), + ), + 'status_id' => array( + 'title' => ts('Pledge Status'), + ), + ), + ), + 'civicrm_pledge_payment' => array( + 'dao' => 'CRM_Pledge_DAO_PledgePayment', + 'fields' => array( + 'total_paid' => array( + 'title' => ts('Total Amount Paid'), + 'type' => CRM_Utils_Type::T_STRING, + 'dbAlias' => 'sum(pledge_payment_civireport.actual_amount)', ), ), - ) + $this->addAddressFields(); + ), + ) + $this->addAddressFields(); $this->_groupFilter = TRUE; $this->_tagFilter = TRUE; diff --git a/CRM/Utils/Hook/Soap.php b/CRM/Utils/Hook/Soap.php index f7aecb0857..a454a10bf2 100644 --- a/CRM/Utils/Hook/Soap.php +++ b/CRM/Utils/Hook/Soap.php @@ -67,12 +67,12 @@ class CRM_Utils_Hook_Soap extends CRM_Utils_Hook { * * @return mixed */ - function invoke( + public function invoke( $numParams, &$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6, $fnSuffix ) { // suppress all hok calls during soap - return; + return NULL; } } diff --git a/CRM/Utils/SoapServer.php b/CRM/Utils/SoapServer.php index eecd779c23..ef81824aac 100644 --- a/CRM/Utils/SoapServer.php +++ b/CRM/Utils/SoapServer.php @@ -146,7 +146,9 @@ class CRM_Utils_SoapServer { return sha1($result[2]); } - /*** MAILER API ***/ + /** + * MAILER API + */ public function mailer_event_bounce($key, $job, $queue, $hash, $body) { $this->verify($key); $params = array( diff --git a/CRM/Utils/System.php b/CRM/Utils/System.php index 353d59351c..1b04f30272 100644 --- a/CRM/Utils/System.php +++ b/CRM/Utils/System.php @@ -1300,13 +1300,13 @@ class CRM_Utils_System { * @param array $params * An array of parameters (see CRM_Utils_System::docURL2 method for names) * - * @return string|void + * @return void|string * URL or link to documentation page, based on provided parameters. */ public static function docURL($params) { if (!isset($params['page'])) { - return; + return NULL; } if (CRM_Utils_Array::value('resource', $params) == 'wiki') { @@ -1464,16 +1464,12 @@ class CRM_Utils_System { CRM_ACL_BAO_Cache::resetCache(); // reset various static arrays used here - CRM_Contact_BAO_Contact::$_importableFields - = CRM_Contact_BAO_Contact::$_exportableFields + CRM_Contact_BAO_Contact::$_importableFields = CRM_Contact_BAO_Contact::$_exportableFields = CRM_Contribute_BAO_Contribution::$_importableFields - = CRM_Contribute_BAO_Contribution::$_exportableFields - = CRM_Pledge_BAO_Pledge::$_exportableFields - = CRM_Contribute_BAO_Query::$_contributionFields - = CRM_Core_BAO_CustomField::$_importFields - = CRM_Core_BAO_Cache::$_cache - = CRM_Core_DAO::$_dbColumnValueCache - = NULL; + = CRM_Contribute_BAO_Contribution::$_exportableFields + = CRM_Pledge_BAO_Pledge::$_exportableFields = CRM_Contribute_BAO_Query::$_contributionFields + = CRM_Core_BAO_CustomField::$_importFields + = CRM_Core_BAO_Cache::$_cache = CRM_Core_DAO::$_dbColumnValueCache = NULL; CRM_Core_OptionGroup::flushAll(); CRM_Utils_PseudoConstant::flushAll(); diff --git a/CRM/Utils/System/Drupal.php b/CRM/Utils/System/Drupal.php index 7af9cc6591..52a1f139c9 100644 --- a/CRM/Utils/System/Drupal.php +++ b/CRM/Utils/System/Drupal.php @@ -416,8 +416,6 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase { /** * Rewrite various system urls to https * - * @param null - * * @return void */ public function mapConfigToSSL() { @@ -454,10 +452,7 @@ class CRM_Utils_System_Drupal extends CRM_Utils_System_DrupalBase { * Load cms bootstrap?. * @param NULL|string $realPath filename of script * - * @return mixed - * false if no auth - * array( - * contactID, ufID, unique string ) if success + * @return mixed false if no auth array(contactID, ufID, unique string ) if success */ public static function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) { require_once 'DB.php'; @@ -561,7 +556,7 @@ AND u.status = 1 * e.g. for drupal: records a watchdog message about the new session, saves the login timestamp, * calls hook_user op 'login' and generates a new session. * - * @param array params + * @param array $params * * FIXME: Document values accepted/required by $params */ @@ -815,7 +810,7 @@ AND u.status = 1 /** * Check is user logged in. * - * @return boolean + * @return bool */ public function isUserLoggedIn() { $isloggedIn = FALSE; diff --git a/CRM/Utils/System/UnitTests.php b/CRM/Utils/System/UnitTests.php index 4c9002373b..895b3e2db1 100644 --- a/CRM/Utils/System/UnitTests.php +++ b/CRM/Utils/System/UnitTests.php @@ -59,7 +59,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { * @param null $pageTitle */ public function setTitle($title, $pageTitle = NULL) { - return; + return NULL; } /** @@ -103,11 +103,11 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { * @param $breadCrumbs */ public function appendBreadCrumb($breadCrumbs) { - return; + return NULL; } public function resetBreadCrumb() { - return; + return NULL; } /** @@ -122,7 +122,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { * @param string $head */ public function addHTMLHead($head) { - return; + return NULL; } public function mapConfigToSSL() { @@ -142,10 +142,10 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { /** * @param mix $action * - * @return string + * @return void */ public function postURL($action) { - return; + return NULL; } /** @@ -182,7 +182,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { * * @return string */ - function url( + public function url( $path = NULL, $query = NULL, $absolute = FALSE, $fragment = NULL, $htmlize = TRUE, $frontend = FALSE, $forceBackend = FALSE @@ -270,7 +270,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { * @param string $message */ public function setMessage($message) { - return; + return NULL; } public function permissionDenied() { @@ -289,7 +289,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { * with the locale or null for none */ /** - * @return string + * @return void */ public function getUFLocale() { return NULL; @@ -314,8 +314,7 @@ class CRM_Utils_System_UnitTests extends CRM_Utils_System_Drupal { * @param string $destination * If present, add destination to querystring (works for Drupal only). * - * @throws Exception - * @return string + * @Throws Exception * loginURL for the current CMS */ public function getLoginURL($destination = '') { diff --git a/CRM/Utils/Tree.php b/CRM/Utils/Tree.php index cbbafa0f4d..ce7140275c 100644 --- a/CRM/Utils/Tree.php +++ b/CRM/Utils/Tree.php @@ -109,10 +109,8 @@ class CRM_Utils_Tree { * Name of the node we are searching for. * @param array (ref) $parentNode which parent node should we search in ? * - * @return array( - * ref) | false node if found else false + * @return array(ref) | false node if found else false */ - //public function &findNode(&$parentNode, $name) public function &findNode($name, &$parentNode) { // if no parent node specified, please start from root node if (!$parentNode) { @@ -146,10 +144,9 @@ class CRM_Utils_Tree { * Check if node is a leaf node. * Currently leaf nodes are strings and non-leaf nodes are arrays * - * @param array ( - * ref) $node node which needs to checked + * @param array $node node which needs to checked * - * @return boolean + * @return bool */ public function isLeafNode(&$node) { return (count($node['children']) ? TRUE : FALSE); @@ -176,7 +173,7 @@ class CRM_Utils_Tree { * * @param string $parentName * Name of the parent ?. - * @param array (ref) - node to be added + * @param array (ref) $node - node to be added * * @return void */ @@ -190,10 +187,9 @@ class CRM_Utils_Tree { /** * Add Data * - * @param string $parentName - * Name of the parent ?. - * @param mixed - data to be added - * @param string - key to be used (optional) + * @param string $parentName Name of the parent ?. + * @param string $childName - key to be used (optional) + * @param mixed $data - data to be added * * @return void */ @@ -212,8 +208,6 @@ class CRM_Utils_Tree { /** * Get Tree * - * @param none - * * @return tree */ public function getTree() { @@ -223,8 +217,6 @@ class CRM_Utils_Tree { /** * Print the tree * - * @param none - * * @return void */ public function display() { diff --git a/CRM/Widget/Widget.php b/CRM/Widget/Widget.php index f15a93b5a5..020738e5fb 100644 --- a/CRM/Widget/Widget.php +++ b/CRM/Widget/Widget.php @@ -62,7 +62,7 @@ class CRM_Widget_Widget { * @param int $contributionPageID * @param string $widgetID * - * @return stdClass + * @return object */ public function getContributionPageData($contributionPageID, $widgetID) { $config = CRM_Core_Config::singleton(); diff --git a/bin/csv/delete.php b/bin/csv/delete.php index eb0b85ec5f..030939085c 100644 --- a/bin/csv/delete.php +++ b/bin/csv/delete.php @@ -31,7 +31,7 @@ * php bin/csv/delete.php -e --file /path/to/csv/file [ -s site.org ] * e.g.: php bin/csv/delete.php -e Contact --file /tmp/delete.csv * - **/ + */ require_once dirname(__DIR__) . '/cli.class.php'; diff --git a/tests/phpunit/CRM/Activity/AllTests.php b/tests/phpunit/CRM/Activity/AllTests.php index 3efc29f025..e3f8bb0ba3 100644 --- a/tests/phpunit/CRM/Activity/AllTests.php +++ b/tests/phpunit/CRM/Activity/AllTests.php @@ -47,7 +47,7 @@ class CRM_Activity_AllTests extends CiviTestSuite { */ private static function getInstance() { if (is_null(self::$instance)) { - self::$instance = new self; + self::$instance = new self(); } return self::$instance; } diff --git a/tests/phpunit/CRM/Core/Config/MailerTest.php b/tests/phpunit/CRM/Core/Config/MailerTest.php index 57cff4d4fd..f7fc6ebc24 100644 --- a/tests/phpunit/CRM/Core/Config/MailerTest.php +++ b/tests/phpunit/CRM/Core/Config/MailerTest.php @@ -56,21 +56,21 @@ class CRM_Core_Config_MailerTest extends CiviUnitTestCase { public function testHookAlterMailer() { $test = $this; $mockMailer = new CRM_Utils_FakeObject(array( - 'send' => function ($recipients, $headers, $body) use ($test) { - $test->calls['send']++; - $test->assertEquals(array('to@example.org'), $recipients); - $test->assertEquals('Subject Example', $headers['Subject']); - }, + 'send' => function ($recipients, $headers, $body) use ($test) { + $test->calls['send']++; + $test->assertEquals(array('to@example.org'), $recipients); + $test->assertEquals('Subject Example', $headers['Subject']); + }, )); CRM_Utils_Hook::singleton()->setHook('civicrm_alterMailer', - function (&$mailer, $driver, $params) use ($test, $mockMailer) { - $test->calls['civicrm_alterMailer']++; - $test->assertTrue(is_string($driver) && !empty($driver)); - $test->assertTrue(is_array($params)); - $test->assertTrue(is_callable(array($mailer, 'send'))); - $mailer = $mockMailer; - } + function (&$mailer, $driver, $params) use ($test, $mockMailer) { + $test->calls['civicrm_alterMailer']++; + $test->assertTrue(is_string($driver) && !empty($driver)); + $test->assertTrue(is_array($params)); + $test->assertTrue(is_callable(array($mailer, 'send'))); + $mailer = $mockMailer; + } ); $params = array(); diff --git a/tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php b/tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php index 4b1e8c7b22..3ce716b9bb 100644 --- a/tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/PayPalProIPNTest.php @@ -75,7 +75,7 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase { $paypalIPN->main(); $contribution = $this->callAPISuccess('contribution', 'get', array( 'contribution_recur_id' => $this->_contributionRecurID, - 'sequential' => 1 + 'sequential' => 1, )); $this->assertEquals(2, $contribution['count']); $this->assertEquals('secondone', $contribution['values'][1]['trxn_id']); @@ -102,17 +102,17 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase { $this->assertEquals(strtotime('+ 1 year', strtotime($membershipEndDate)), strtotime($this->callAPISuccessGetValue('membership', array('return' => 'end_date')))); $contribution = $this->callAPISuccess('contribution', 'get', array( 'contribution_recur_id' => $this->_contributionRecurID, - 'sequential' => 1 + 'sequential' => 1, )); $this->assertEquals(2, $contribution['count']); $this->assertEquals('secondone', $contribution['values'][1]['trxn_id']); $this->callAPISuccessGetCount('line_item', array( 'entity_id' => $this->ids['membership'], - 'entity_table' => 'civicrm_membership' + 'entity_table' => 'civicrm_membership', ), 2); $this->callAPISuccessGetSingle('line_item', array( 'contribution_id' => $contribution['values'][1]['id'], - 'entity_table' => 'civicrm_membership' + 'entity_table' => 'civicrm_membership', )); $this->callAPISuccessGetSingle('membership_payment', array('contribution_id' => $contribution['values'][1]['id'])); @@ -141,7 +141,7 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase { $paypalIPN->main(); $contribution = $this->callAPISuccess('contribution', 'get', array( 'contribution_recur_id' => $this->_contributionRecurID, - 'sequential' => 1 + 'sequential' => 1, )); $this->assertEquals(1, $contribution['count']); $this->assertEquals('secondone', $contribution['values'][0]['trxn_id']); @@ -321,11 +321,7 @@ class CRM_Core_Payment_PayPalProIPNTest extends CiviUnitTestCase { 'amount_per_cycle' => '15.00', 'mc_gross' => '15.00', 'payment_date' => '03:59:05 Jul 14, 2013 PDT', - 'rp_invoice_id' => 'i=' . $this->_invoiceID - . '&m=contribute&c=' - . $this->_contactID - . '&r=' . $this->_contributionRecurID - . '&b=' . $this->_contributionID . '&p=' . $this->_contributionPageID, + 'rp_invoice_id' => 'i=' . $this->_invoiceID . '&m=contribute&c=' . $this->_contactID . '&r=' . $this->_contributionRecurID . '&b=' . $this->_contributionID . '&p=' . $this->_contributionPageID, 'payment_status' => 'Completed', 'business' => 'nowhere@civicrm.org', 'last_name' => 'Roberty', diff --git a/tests/phpunit/CiviTest/AuthorizeNet.php b/tests/phpunit/CiviTest/AuthorizeNet.php index e0c46fbca4..dc64f5d407 100644 --- a/tests/phpunit/CiviTest/AuthorizeNet.php +++ b/tests/phpunit/CiviTest/AuthorizeNet.php @@ -37,7 +37,7 @@ class AuthorizeNet extends PHPUnit_Framework_Testcase { * @param int $id * Id of the PayPal Pro payment processor. * to be deleted - * @return boolean + * @return bool * true if payment processor deleted, false otherwise */ public function delete($id) { diff --git a/tests/phpunit/WebTest/Case/AddCaseTypeTest.php b/tests/phpunit/WebTest/Case/AddCaseTypeTest.php index 3b32266cfe..88f42e0a64 100644 --- a/tests/phpunit/WebTest/Case/AddCaseTypeTest.php +++ b/tests/phpunit/WebTest/Case/AddCaseTypeTest.php @@ -50,7 +50,7 @@ class WebTest_Case_AddCaseTypeTest extends CiviSeleniumTestCase { 'edit-2-access-all-cases-and-activities', 'edit-2-access-my-cases-and-activities', 'edit-2-administer-civicase', - 'edit-2-delete-in-civicase' + 'edit-2-delete-in-civicase', ); $this->changePermissions($permission); diff --git a/tests/phpunit/api/v3/ActivityTest.php b/tests/phpunit/api/v3/ActivityTest.php index 32e8ad6425..65aca47531 100644 --- a/tests/phpunit/api/v3/ActivityTest.php +++ b/tests/phpunit/api/v3/ActivityTest.php @@ -341,11 +341,11 @@ class api_v3_ActivityTest extends CiviUnitTestCase { $result = $this->callAPIAndDocument('activity', 'create', $params, __FUNCTION__, __FILE__, $description, $subfile); $result = $this->callAPISuccess('activity', 'get', array( - 'id' => $result['id'], - 'version' => $this->_apiversion, - 'return.assignee_contact_id' => 1, - 'return.target_contact_id' => 1 - )); + 'id' => $result['id'], + 'version' => $this->_apiversion, + 'return.assignee_contact_id' => 1, + 'return.target_contact_id' => 1, + )); $this->assertEquals($this->_contactID, $result['values'][$result['id']]['assignee_contact_id'][0], 'in line ' . __LINE__); $this->assertEquals($this->_contactID, $result['values'][$result['id']]['target_contact_id'][0], 'in line ' . __LINE__); @@ -371,10 +371,10 @@ class api_v3_ActivityTest extends CiviUnitTestCase { $params['custom_' . $ids['custom_field_id']] = "custom string"; $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__); $result = $this->callAPISuccess($this->_entity, 'get', array( - 'return.custom_' . $ids['custom_field_id'] => 1, - 'version' => 3, - 'id' => $result['id'] - )); + 'return.custom_' . $ids['custom_field_id'] => 1, + 'version' => 3, + 'id' => $result['id'], + )); $this->assertEquals("custom string", $result['values'][$result['id']]['custom_' . $ids['custom_field_id']], ' in line ' . __LINE__); $this->customFieldDelete($ids['custom_field_id']); @@ -408,9 +408,9 @@ class api_v3_ActivityTest extends CiviUnitTestCase { $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__, $description, $subfile, 'Create'); $result = $this->callAPIAndDocument($this->_entity, 'get', array( - 'return.custom_' . $customField['id'] => 1, - 'id' => $result['id'] - ), __FUNCTION__, __FILE__, 'Get with Contact Ref Custom Field', 'ContactRefCustomFieldGet', 'get'); + 'return.custom_' . $customField['id'] => 1, + 'id' => $result['id'], + ), __FUNCTION__, __FILE__, 'Get with Contact Ref Custom Field', 'ContactRefCustomFieldGet', 'get'); $this->assertEquals('Anderson, Anthony', $result['values'][$result['id']]['custom_' . $customField['id']], ' in line ' . __LINE__); $this->assertEquals($this->_contactID, $result['values'][$result['id']]['custom_' . $customField['id'] . "_id"], ' in line ' . __LINE__); @@ -590,18 +590,18 @@ class api_v3_ActivityTest extends CiviUnitTestCase { $activity = $this->callAPISuccess('Activity', 'Create', $params); $activityget = $this->callAPISuccess('Activity', 'get', array( - 'id' => $activity['id'], - 'target_contact_id' => $contact2, - 'return.target_contact_id' => 1 - )); + 'id' => $activity['id'], + 'target_contact_id' => $contact2, + 'return.target_contact_id' => 1, + )); $this->assertEquals($activity['id'], $activityget['id'], 'In line ' . __LINE__); $this->assertEquals($contact2, $activityget['values'][$activityget['id']]['target_contact_id'][0], 'In line ' . __LINE__); $activityget = $this->callAPISuccess('activity', 'get', array( - 'target_contact_id' => $this->_contactID, - 'return.target_contact_id' => 1, - 'id' => $activity['id'] - )); + 'target_contact_id' => $this->_contactID, + 'return.target_contact_id' => 1, + 'id' => $activity['id'], + )); if ($activityget['count'] > 0) { $this->assertNotEquals($contact2, $activityget['values'][$activityget['id']]['target_contact_id'][0], 'In line ' . __LINE__); } @@ -633,7 +633,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { $this->assertEquals(0, $result['count'], 'No activities of status 1 should exist'); $result = $this->callAPISuccess('Activity', 'Get', array( 'version' => $this->_apiversion, - 'status_id' => '2' + 'status_id' => '2', )); $this->assertEquals(0, $result['count'], 'No activities of status 1 should exist'); @@ -890,10 +890,10 @@ class api_v3_ActivityTest extends CiviUnitTestCase { $activityId = $result['id']; $result = $this->callAPISuccess($this->_entity, 'get', array( - 'return.custom_' . $ids['custom_field_id'] => 1, - 'version' => 3, - 'id' => $result['id'] - )); + 'return.custom_' . $ids['custom_field_id'] => 1, + 'version' => 3, + 'id' => $result['id'], + )); $this->assertEquals("custom string", $result['values'][$result['id']]['custom_' . $ids['custom_field_id']], ' in line ' . __LINE__); $this->assertEquals("2009-10-18 00:00:00", $result['values'][$result['id']]['activity_date_time'], ' in line ' . __LINE__); $fields = $this->callAPISuccess('activity', 'getfields', array('version' => $this->_apiversion)); @@ -914,10 +914,10 @@ class api_v3_ActivityTest extends CiviUnitTestCase { $result = $this->callAPISuccess('Activity', 'Create', $params); $result = $this->callAPISuccess($this->_entity, 'get', array( - 'return.custom_' . $ids['custom_field_id'] => 1, - 'version' => 3, - 'id' => $result['id'] - )); + 'return.custom_' . $ids['custom_field_id'] => 1, + 'version' => 3, + 'id' => $result['id'], + )); $this->assertEquals("Updated my test data", $result['values'][$result['id']]['custom_' . $ids['custom_field_id']], ' in line ' . __LINE__); } @@ -1130,7 +1130,7 @@ class api_v3_ActivityTest extends CiviUnitTestCase { ), 'api.activity.create' => array( 'subject' => 'send letter', - 'activity_type_id' => '$value.api.activity_type.create.values.0.value' + 'activity_type_id' => '$value.api.activity_type.create.values.0.value', ), )); -- 2.25.1