Skip to content

Commit

Permalink
Merge pull request #21529 from eileenmcnaughton/view
Browse files Browse the repository at this point in the history
dev/core#2843 push new link to the end
  • Loading branch information
mattwire authored Sep 19, 2021
2 parents 83e68a9 + b14db14 commit 4be8d34
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions CRM/Contribute/Page/Tab.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ public static function recurLinks(int $recurID, $context = 'contribution') {
];

$templateContribution = CRM_Contribute_BAO_ContributionRecur::getTemplateContribution($recurID);
if (!empty($templateContribution['id']) && $paymentProcessorObj->supportsEditRecurringContribution()) {
// 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}&force_create_template=1",
];
}
if (
(CRM_Core_Permission::check('edit contributions') || $context !== 'contribution') &&
($paymentProcessorObj->supports('ChangeSubscriptionAmount')
Expand Down Expand Up @@ -102,6 +92,16 @@ public static function recurLinks(int $recurID, $context = 'contribution') {
'qs' => "reset=1&crid=%%crid%%&cid=%%cid%%&context={$context}",
];
}
if (!empty($templateContribution['id']) && $paymentProcessorObj->supportsEditRecurringContribution()) {
// 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}&force_create_template=1",
];
}

return $links;
}
Expand Down

0 comments on commit 4be8d34

Please sign in to comment.