From 02af368362ba51841fb27d53dab8d4de3cd980db Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Tue, 20 May 2014 11:30:20 +1200 Subject: [PATCH] minor code tidy ups - in don't pass as ref per std we have been moving to --- CRM/Contribute/BAO/Contribution.php | 23 +++++++++++++++-------- CRM/Member/BAO/Membership.php | 6 ++---- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index e92faa48a4..e916cbc5f7 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -2302,6 +2302,14 @@ WHERE contribution_id = %1 "; * function & breaking it down into manageable chunks. Eventually it will be refactored into something else * Note we send directly from this function in some cases because it is only partly refactored * Don't call this function directly as the signature will change + * + * @param $values + * @param $input + * @param $template CRM_Core_SMARTY + * @param bool $recur + * @param bool $returnMessageText + * + * @return mixed */ function _assignMessageVariablesToTemplate(&$values, $input, &$template, $recur = FALSE, $returnMessageText = True) { $template->assign('first_name', $this->_relatedObjects['contact']->first_name); @@ -2310,7 +2318,7 @@ WHERE contribution_id = %1 "; if (!empty($values['lineItem']) && !empty($this->_relatedObjects['membership'])) { $template->assign('useForMember', true); } - //assign honor infomation to receiptmessage + //assign honor information to receipt message $softRecord = CRM_Contribute_BAO_ContributionSoft::getSoftContribution($this->id); if (isset($softRecord['soft_credit'])) { @@ -2543,16 +2551,15 @@ WHERE contribution_id = %1 "; * @param array $params contribution object, line item array and params for trxn * * - * @param null $financialTrxnVals + * @param array $financialTrxnValues * * @return null|object * @access public * @static */ - static function recordFinancialAccounts(&$params, $financialTrxnVals = NULL) { - $skipRecords = $update = FALSE; - // in few scenarios we require the trxn record details which has got created - $return = NULL; + static function recordFinancialAccounts(&$params, $financialTrxnValues = NULL) { + $skipRecords = $update = $return = FALSE; + $additionalParticipantId = array(); $contributionStatuses = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); @@ -2668,8 +2675,8 @@ WHERE contribution_id = %1 "; } // consider external values passed for recording transaction entry - if (!empty($financialTrxnVals)) { - $trxnParams = array_merge($trxnParams, $financialTrxnVals); + if (!empty($financialTrxnValues)) { + $trxnParams = array_merge($trxnParams, $financialTrxnValues); } $params['trxnParams'] = $trxnParams; diff --git a/CRM/Member/BAO/Membership.php b/CRM/Member/BAO/Membership.php index 53b0c20ea7..6a394501ad 100644 --- a/CRM/Member/BAO/Membership.php +++ b/CRM/Member/BAO/Membership.php @@ -73,7 +73,7 @@ class CRM_Member_BAO_Membership extends CRM_Member_DAO_Membership { * @access public * @static */ - static function add(&$params, &$ids) { + static function add(&$params, $ids = array()) { $oldStatus = $oldType = NULL; if (!empty($ids['membership'])) { CRM_Utils_Hook::pre('edit', 'Membership', $ids['membership'], $params); @@ -2520,13 +2520,11 @@ INNER JOIN civicrm_contact contact ON ( contact.id = membership.contact_id AND * @access public */ static function updateAllMembershipStatus() { - require_once 'api/api.php'; //get all active statuses of membership, CRM-3984 $allStatus = CRM_Member_PseudoConstant::membershipStatus(); $statusLabels = CRM_Member_PseudoConstant::membershipStatus(NULL, NULL, 'label'); $allTypes = CRM_Member_PseudoConstant::membershipType(); - $contribStatus = CRM_Contribute_PseudoConstant::contributionStatus(NULL, 'name'); // get only memberships with active membership types $query = " @@ -2724,7 +2722,7 @@ WHERE civicrm_membership.is_test = 0"; * @param array $params array of submitted params * @param array $ids (param in process of being removed - try to use params) array of ids * - * @return void + * @return CRM_Contribute_BAO_Contribution * @static */ static function recordMembershipContribution( &$params, $ids = array()) { -- 2.25.1