From db52b6f6eaeff2f89c8e84413e271373cfa573d4 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Thu, 14 Apr 2022 18:20:08 +1200 Subject: [PATCH] Fix button breakage on viewContribution --- CRM/Contribute/BAO/Contribution.php | 42 +++++++++---------- CRM/Contribute/Form/ContributionView.php | 1 + .../CRM/Contribute/Form/PaymentInfoBlock.tpl | 2 +- 3 files changed, 23 insertions(+), 22 deletions(-) diff --git a/CRM/Contribute/BAO/Contribution.php b/CRM/Contribute/BAO/Contribution.php index 96637af02d..0813283626 100644 --- a/CRM/Contribute/BAO/Contribution.php +++ b/CRM/Contribute/BAO/Contribution.php @@ -4271,50 +4271,50 @@ LIMIT 1;"; } $actionLinks = []; $actionLinks[] = [ - 'url' => CRM_Utils_System::url('civicrm/payment', [ - 'action' => 'add', - 'reset' => 1, - 'id' => $id, - 'is_refund' => 0, - ]), + 'url' => 'civicrm/payment', 'title' => ts('Record Payment'), 'accessKey' => '', 'ref' => '', 'name' => '', - 'qs' => '', + 'qs' => [ + 'action' => 'add', + 'reset' => 1, + 'id' => $id, + 'is_refund' => 0, + ], 'extra' => '', ]; if (CRM_Core_Config::isEnabledBackOfficeCreditCardPayments()) { $actionLinks[] = [ - 'url' => CRM_Utils_System::url('civicrm/payment', [ + 'url' => 'civicrm/payment', + 'title' => ts('Submit Credit Card payment'), + 'accessKey' => '', + 'ref' => '', + 'name' => '', + 'qs' => [ 'action' => 'add', 'reset' => 1, 'is_refund' => 0, 'id' => $id, 'mode' => 'live', - ]), - 'title' => ts('Submit Credit Card payment'), - 'accessKey' => '', - 'ref' => '', - 'name' => '', - 'qs' => '', + ], 'extra' => '', ]; } if ($contributionStatus !== 'Pending') { $actionLinks[] = [ - 'url' => CRM_Utils_System::url('civicrm/payment', [ - 'action' => 'add', - 'reset' => 1, - 'id' => $id, - 'is_refund' => 1, - ]), + 'url' => 'civicrm/payment', 'title' => ts('Record Refund'), 'accessKey' => '', 'ref' => '', 'name' => '', - 'qs' => '', + 'qs' => [ + 'action' => 'add', + 'reset' => 1, + 'id' => $id, + 'is_refund' => 1, + ], 'extra' => '', ]; } diff --git a/CRM/Contribute/Form/ContributionView.php b/CRM/Contribute/Form/ContributionView.php index f71c4272da..2127f3bcb5 100644 --- a/CRM/Contribute/Form/ContributionView.php +++ b/CRM/Contribute/Form/ContributionView.php @@ -357,6 +357,7 @@ class CRM_Contribute_Form_ContributionView extends CRM_Core_Form { $paymentInfo = CRM_Contribute_BAO_Contribution::getPaymentInfo($id, 'contribution', TRUE); $title = ts('View Payment'); $this->assign('transaction', TRUE); + // Used in paymentInfoBlock.tpl $this->assign('payments', $paymentInfo['transaction']); $this->assign('paymentLinks', $paymentInfo['payment_links']); return $title; diff --git a/templates/CRM/Contribute/Form/PaymentInfoBlock.tpl b/templates/CRM/Contribute/Form/PaymentInfoBlock.tpl index bcb23f9a56..b08f74aa39 100644 --- a/templates/CRM/Contribute/Form/PaymentInfoBlock.tpl +++ b/templates/CRM/Contribute/Form/PaymentInfoBlock.tpl @@ -41,7 +41,7 @@ {/if} {foreach from=$paymentLinks item=paymentLink} - {ts}{$paymentLink.title}{/ts} + {ts}{$paymentLink.title}{/ts} {/foreach} {/crmRegion} -- 2.25.1