Refresh member and contribution tabs when saving relationships
authorColeman Watts <coleman@civicrm.org>
Fri, 26 Sep 2014 13:09:57 +0000 (09:09 -0400)
committerColeman Watts <coleman@civicrm.org>
Fri, 26 Sep 2014 13:09:57 +0000 (09:09 -0400)
templates/CRM/Contact/Page/View/Relationship.tpl

index 24765d8ee05a2f579634ea3c1ada83901456058a..06c40048934180d6c0701e1d192b2f7b0f120e5c 100644 (file)
@@ -29,7 +29,7 @@
 {elseif $action neq 16} {* add, update or view *}
   {include file="CRM/Contact/Form/Relationship.tpl"}
 {else}
-  <div class="view-content">
+  <div id="contact-summary-relationship-tab" class="view-content">
     {if $permission EQ 'edit'}
       <div class="action-link">
         <a accesskey="N" href="{crmURL p='civicrm/contact/view/rel' q="cid=`$contactId`&action=add&reset=1"}"
   </div>
 
   {include file="CRM/common/enableDisableApi.tpl"}
+  {literal}
+  <script type="text/javascript">
+    CRM.$(function($) {
+      // Changing relationships may affect related members and contributions. Ensure they are refreshed.
+      $('#contact-summary-relationship-tab').on('crmPopupFormSuccess', function() {
+        CRM.tabHeader.resetTab('tab_contribute');
+        CRM.tabHeader.resetTab('tab_member');
+      });
+    });
+  </script>
+  {/literal}
 {/if} {* close of custom data else*}