Add recurring contribution link to membership and contribution detail
authorMatthew Wire <devel@mrwire.co.uk>
Mon, 4 Dec 2017 11:32:25 +0000 (11:32 +0000)
committerMatthew Wire <devel@mrwire.co.uk>
Wed, 17 Jan 2018 11:50:49 +0000 (18:50 +0700)
CRM/Member/Form/MembershipView.php
templates/CRM/Contribute/Form/ContributionView.tpl
templates/CRM/Member/Form/MembershipView.tpl

index 65c63d4868835a188183fcfa4f4c520ac74e4a01..4f3f201715e85663ad7bc6ef084de6fb6f50b98c 100644 (file)
@@ -163,7 +163,7 @@ class CRM_Member_Form_MembershipView extends CRM_Core_Form {
         $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 {
index 5c18420a31c614a8df0ea0a4454cd68f4efc1069..e3edf85b3f4e8ae926b855c0ce53fed953ef0872 100644 (file)
@@ -95,7 +95,9 @@
                &nbsp; {$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}
index ab24c20101d22604c0b862e4a36f1f9176a5f62d..f95cae83f4f7f30378826f585899149a04dd5c55 100644 (file)
         <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"}