CRM-20058 Added check for backoffice credit card payment enabled
authorEdsel <edsel.lopez@jmaconsulting.biz>
Thu, 9 Mar 2017 13:30:47 +0000 (19:00 +0530)
committerEdsel <edsel.lopez@jmaconsulting.biz>
Thu, 9 Mar 2017 13:30:47 +0000 (19:00 +0530)
----------------------------------------
* CRM-20058: Add Credit Card Payment link for partially paid contribution
  https://issues.civicrm.org/jira/browse/CRM-20058

CRM/Contribute/Selector/Search.php
CRM/Event/Selector/Search.php

index edbc66f565f398e976d1edbe8ffcaf781189376b..689570aa18956bb9980b30c548aceb436b08c2e2 100644 (file)
@@ -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',
index eabe1342ab9e1f795379175a716d562dc9768a2f..bdef479abbdf242c34f9b76002fd0ab3bf5f8759 100644 (file)
@@ -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') {