From 059326f337dc09e32f020461b597c9b2d9dd59ae Mon Sep 17 00:00:00 2001 From: Edsel Date: Thu, 9 Mar 2017 19:00:47 +0530 Subject: [PATCH] CRM-20058 Added check for backoffice credit card payment enabled ---------------------------------------- * CRM-20058: Add Credit Card Payment link for partially paid contribution https://issues.civicrm.org/jira/browse/CRM-20058 --- CRM/Contribute/Selector/Search.php | 2 +- CRM/Event/Selector/Search.php | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CRM/Contribute/Selector/Search.php b/CRM/Contribute/Selector/Search.php index edbc66f565..689570aa18 100644 --- a/CRM/Contribute/Selector/Search.php +++ b/CRM/Contribute/Selector/Search.php @@ -448,7 +448,7 @@ class CRM_Contribute_Selector_Search extends CRM_Core_Selector_Base implements C if ($row['contribution_status_name'] == 'Pending refund') { $buttonName = ts('Record Refund'); } - else { + elseif (CRM_Core_Config::isEnabledBackOfficeCreditCardPayments()) { $links[CRM_Core_Action::BASIC] = array( 'name' => ts('Submit Credit Card payment'), 'url' => 'civicrm/payment/add', diff --git a/CRM/Event/Selector/Search.php b/CRM/Event/Selector/Search.php index eabe1342ab..bdef479abb 100644 --- a/CRM/Event/Selector/Search.php +++ b/CRM/Event/Selector/Search.php @@ -370,12 +370,14 @@ class CRM_Event_Selector_Search extends CRM_Core_Selector_Base implements CRM_Co 'qs' => 'reset=1&id=%%id%%&cid=%%cid%%&action=add&component=event', 'title' => ts('Record Payment'), ); - $links[CRM_Core_Action::BASIC] = array( - 'name' => ts('Submit Credit Card payment'), - 'url' => 'civicrm/payment/add', - 'qs' => 'reset=1&id=%%id%%&cid=%%cid%%&action=add&component=event&mode=live', - 'title' => ts('Submit Credit Card payment'), - ); + if (CRM_Core_Config::isEnabledBackOfficeCreditCardPayments()) { + $links[CRM_Core_Action::BASIC] = array( + 'name' => ts('Submit Credit Card payment'), + 'url' => 'civicrm/payment/add', + 'qs' => 'reset=1&id=%%id%%&cid=%%cid%%&action=add&component=event&mode=live', + 'title' => ts('Submit Credit Card payment'), + ); + } } if ($statusTypes[$row['participant_status_id']] == 'Pending refund') { -- 2.25.1