X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContribute%2FBAO%2FContribution%2FUtils.php;h=3ca834ebbbe7872192bd7247a68199158ee47af9;hb=ac30252393b3b9d8162994f59bb63e2b89ddacdc;hp=13ad6d9ecda5e7c1766c830a7c9647178861dd87;hpb=ec9bb041d5407d659b30d3ecd00b5db60d71ad52;p=civicrm-core.git diff --git a/CRM/Contribute/BAO/Contribution/Utils.php b/CRM/Contribute/BAO/Contribution/Utils.php index 13ad6d9ecd..3ca834ebbb 100644 --- a/CRM/Contribute/BAO/Contribution/Utils.php +++ b/CRM/Contribute/BAO/Contribution/Utils.php @@ -1,9 +1,9 @@ id = $paymentParams['financial_type']; } - elseif (CRM_Utils_Array::value('pledge_id', $form->_values)) { + elseif (!empty($form->_values['pledge_id'])) { $contributionType->id = CRM_Core_DAO::getFieldValue('CRM_Pledge_DAO_Pledge', $form->_values['pledge_id'], 'financial_type_id' @@ -200,7 +200,7 @@ class CRM_Contribute_BAO_Contribution_Utils { } } elseif ($form->_values['is_monetary'] && $form->_amount > 0.0) { - if (CRM_Utils_Array::value('is_recur', $paymentParams) && + if (!empty($paymentParams['is_recur']) && $form->_contributeMode == 'direct' ) { @@ -240,10 +240,10 @@ class CRM_Contribute_BAO_Contribution_Utils { if (is_a($result, 'CRM_Core_Error')) { //make sure to cleanup db for recurring case. - if (CRM_Utils_Array::value('contributionID', $paymentParams)) { + if (!empty($paymentParams['contributionID'])) { CRM_Contribute_BAO_Contribution::deleteContribution($paymentParams['contributionID']); } - if (CRM_Utils_Array::value('contributionRecurID', $paymentParams)) { + if (!empty($paymentParams['contributionRecurID'])) { CRM_Contribute_BAO_ContributionRecur::deleteRecurContribution($paymentParams['contributionRecurID']); } @@ -279,9 +279,8 @@ class CRM_Contribute_BAO_Contribution_Utils { // check if pending was set to true by payment processor $pending = FALSE; - if (CRM_Utils_Array::value('contribution_status_pending', - $form->_params - )) { + if (!empty($form->_params +['contribution_status_pending'])) { $pending = TRUE; } if (!(!empty($paymentParams['is_recur']) && $form->_contributeMode == 'direct')) { @@ -418,7 +417,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = contrib.contact_id ) } $created = TRUE; - if (CRM_Utils_Array::value('cms_create_account', $params)) { + if (!empty($params['cms_create_account'])) { $params['contactID'] = $contactID; if (!CRM_Core_BAO_CMSUser::create($params, $mail)) { CRM_Core_Error::statusBounce(ts('Your profile is not saved and Account is not created.')); @@ -602,11 +601,11 @@ INNER JOIN civicrm_contact contact ON ( contact.id = contrib.contact_id ) if ($riskInfo['google-order-number']['VALUE'] == $apiParams[2]['google-order-number']['VALUE']) { foreach ($riskInfo['risk-information']['billing-address'] as $field => $info) { - if (CRM_Utils_Array::value($field, $mapper['location'])) { + if (!empty($mapper['location'][$field])) { $params['address'][1][$mapper['location'][$field]] = $info['VALUE']; } - elseif (CRM_Utils_Array::value($field, $mapper['contact'])) { - if ($newOrder && CRM_Utils_Array::value('structured-name', $newOrder['buyer-billing-address'])) { + elseif (!empty($mapper['contact'][$field])) { + if ($newOrder && !empty($newOrder['buyer-billing-address']['structured-name'])) { foreach ($newOrder['buyer-billing-address']['structured-name'] as $namePart => $nameValue) { $params[$mapper['contact'][$namePart]] = $nameValue['VALUE']; } @@ -615,7 +614,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = contrib.contact_id ) $params[$mapper['contact'][$field]] = $info['VALUE']; } } - elseif (CRM_Utils_Array::value($field, $mapper['transaction'])) { + elseif (!empty($mapper['transaction'][$field])) { $transaction[$mapper['transaction'][$field]] = $info['VALUE']; } } @@ -661,7 +660,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = contrib.contact_id ) } foreach ($localMapper as $localKey => $localVal) { - if (CRM_Utils_Array::value($localKey, $mapper['transaction'])) { + if (!empty($mapper['transaction'][$localKey])) { $transaction[$mapper['transaction'][$localKey]] = $localVal; } } @@ -693,7 +692,7 @@ INNER JOIN civicrm_contact contact ON ( contact.id = contrib.contact_id ) $dedupeParams['check_permission'] = FALSE; $dupeIds = CRM_Dedupe_Finder::dupesByParams($dedupeParams, 'Individual'); // if we find more than one contact, use the first one - if (CRM_Utils_Array::value(0, $dupeIds)) { + if (!empty($dupeIds[0])) { $params['contact_id'] = $dupeIds[0]; } $contact = CRM_Contact_BAO_Contact::create($params);