Show contact name on recurring contribution view and improve consistency with Contrib...
authorMatthew Wire (MJW Consulting) <mjw@mjwconsult.co.uk>
Fri, 14 Sep 2018 10:09:24 +0000 (11:09 +0100)
committerMatthew Wire (MJW Consulting) <mjw@mjwconsult.co.uk>
Fri, 14 Sep 2018 10:09:24 +0000 (11:09 +0100)
CRM/Contribute/Page/ContributionRecur.php
templates/CRM/Contribute/Page/ContributionRecur.tpl

index dea041f3b6a94d498e33a8af07fb1f0c497f0dbc..fa9b0daae2adfb93237fa6ec6d6631e18e954dc2 100644 (file)
@@ -83,6 +83,17 @@ class CRM_Contribute_Page_ContributionRecur extends CRM_Core_Page {
     CRM_Core_BAO_CustomGroup::buildCustomDataView($this, $groupTree, FALSE, NULL, NULL, NULL, $contributionRecur['id']);
 
     $this->assign('recur', $contributionRecur);
+
+    $displayName = CRM_Contact_BAO_Contact::displayName($contributionRecur['contact_id']);
+    $this->assign('displayName', $displayName);
+
+    // Check if this is default domain contact CRM-10482
+    if (CRM_Contact_BAO_Contact::checkDomainContact($contributionRecur['contact_id'])) {
+      $displayName .= ' (' . ts('default organization') . ')';
+    }
+
+    // omitting contactImage from title for now since the summary overlay css doesn't work outside of our crm-container
+    CRM_Utils_System::setTitle(ts('View Recurring Contribution from') . ' ' . $displayName);
   }
 
   public function preProcess() {
index 6f8371aee9faae198cda06845fa208ac1b94115d..e838277b1ca50a5f8a9538612ebd6cd961a684c6 100644 (file)
           <strong>{ts}This is a TEST transaction{/ts}</strong>
         </div>
         {/if}
-        <h3>{ts}View Recurring Payment{/ts}</h3>
         <div class="crm-block crm-content-block crm-recurcontrib-view-block">
           <table class="crm-info-panel">
+            <tr>
+              <td class="label">{ts}From{/ts}</td>
+              <td class="bold"><a href="{crmURL p='civicrm/contact/view' q="cid=`$recur.contact_id`"}">{$displayName}</a></td>
+            </tr>
             <tr><td class="label">{ts}Amount{/ts}</td><td>{$recur.amount|crmMoney:$recur.currency}{if $is_test} ({ts}test{/ts}){/if}</td></tr>
             <tr><td class="label">{ts}Frequency{/ts}</td><td>every {$recur.frequency_interval} {$recur.frequency_unit}</td></tr>
             <tr><td class="label">{ts}Installments{/ts}</td><td>{$recur.installments}</td></tr>