Skip to content

Commit

Permalink
Add recurring contribution link to membership and contribution detail
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwire committed Jan 17, 2018
1 parent eeda3fc commit 4627f70
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CRM/Member/Form/MembershipView.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function preProcess() {
$finTypeId = CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipType', $values['membership_type_id'], 'financial_type_id');
$finType = CRM_Contribute_PseudoConstant::financialType($finTypeId);
if (!CRM_Core_Permission::check('view contributions of type ' . $finType)) {
CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
CRM_Core_Error::statusBounce(ts('You do not have permission to access this page.'));
}
}
else {
Expand Down
4 changes: 3 additions & 1 deletion templates/CRM/Contribute/Form/ContributionView.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,9 @@
  {$total_amount|crmMoney:$currency}
</strong></a>&nbsp;
{if $contribution_recur_id}
<strong>{ts}Recurring Contribution{/ts}</strong>
<a class="crm-hover-button" href='{crmURL p="civicrm/contact/view/contributionrecur" q="reset=1&id=`$contribution_recur_id`&cid=`$contact_id`&context=contribution"}'>
<strong>{ts}Recurring Contribution{/ts}</strong>
</a>
<br/>
{ts}Installments{/ts}: {if $recur_installments}{$recur_installments}{else}{ts}(ongoing){/ts}{/if}, {ts}Interval{/ts}: {$recur_frequency_interval} {$recur_frequency_unit}(s)
{/if}
Expand Down
8 changes: 8 additions & 0 deletions templates/CRM/Member/Form/MembershipView.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,14 @@
<tr><td class="label">{ts}Start date{/ts}</td><td>{$start_date|crmDate}</td></tr>
<tr><td class="label">{ts}End date{/ts}</td><td>{$end_date|crmDate}</td></tr>
<tr><td class="label">{ts}Auto-renew{/ts}</td><td>{$auto_renew}</td></tr>
{if $contribution_recur_id}
<tr>
<td class="label">{ts}Recurring Contribution{/ts}</td>
<td>
<a class="crm-hover-button" href='{crmURL p="civicrm/contact/view/contributionrecur" q="reset=1&id=`$recurContribution`&cid=`$contactId`&context=contribution"}'>View Recurring Contribution</a>
</td>
</tr>
{/if}
</table>

{include file="CRM/Custom/Page/CustomDataView.tpl"}
Expand Down

0 comments on commit 4627f70

Please sign in to comment.