dev/financial#6 exclude template contributions from the contact summary and add a...
authorJaap Jansma <jaap.jansma@civicoop.org>
Mon, 21 Jun 2021 14:53:43 +0000 (16:53 +0200)
committerJaap Jansma <jaap.jansma@civicoop.org>
Mon, 21 Jun 2021 14:53:43 +0000 (16:53 +0200)
CRM/Contribute/Page/Tab.php

index 151326fe084e4aa88b7df44760b081be7bf1b436..3ea488b55805b1d80f97f55ebc1ed55d15e0e076 100644 (file)
@@ -49,7 +49,6 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page {
    */
   public static function recurLinks(int $recurID, $context = 'contribution') {
     $paymentProcessorObj = Civi\Payment\System::singleton()->getById(CRM_Contribute_BAO_ContributionRecur::getPaymentProcessorID($recurID));
-    $templateContribution = CRM_Contribute_BAO_ContributionRecur::getTemplateContribution($recurID);
     $links = [
       CRM_Core_Action::VIEW => [
         'name' => ts('View'),
@@ -58,16 +57,7 @@ class CRM_Contribute_Page_Tab extends CRM_Core_Page {
         'qs' => "reset=1&id=%%crid%%&cid=%%cid%%&context={$context}",
       ],
     ];
-    if (!empty($templateContribution['id']) && !empty($templateContribution['is_template'])) {
-      // Use constant CRM_Core_Action::PREVIEW as there is no such thing as view template.
-      // And reusing view will mangle the actions.
-      $links[CRM_Core_Action::PREVIEW] = [
-        'name' => ts('View Template'),
-        'title' => ts('View Template Contribution'),
-        'url' => 'civicrm/contact/view/contribution',
-        'qs' => "reset=1&id={$templateContribution['id']}&cid=%%cid%%&action=view&context={$context}",
-      ];
-    }
+
     if (
       (CRM_Core_Permission::check('edit contributions') || $context !== 'contribution') &&
       ($paymentProcessorObj->supports('ChangeSubscriptionAmount')