| 1 | {* |
| 2 | +--------------------------------------------------------------------+ |
| 3 | | CiviCRM version 4.7 | |
| 4 | +--------------------------------------------------------------------+ |
| 5 | | Copyright CiviCRM LLC (c) 2004-2015 | |
| 6 | +--------------------------------------------------------------------+ |
| 7 | | This file is a part of CiviCRM. | |
| 8 | | | |
| 9 | | CiviCRM is free software; you can copy, modify, and distribute it | |
| 10 | | under the terms of the GNU Affero General Public License | |
| 11 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | |
| 12 | | | |
| 13 | | CiviCRM is distributed in the hope that it will be useful, but | |
| 14 | | WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | |
| 16 | | See the GNU Affero General Public License for more details. | |
| 17 | | | |
| 18 | | You should have received a copy of the GNU Affero General Public | |
| 19 | | License and the CiviCRM Licensing Exception along | |
| 20 | | with this program; if not, contact CiviCRM LLC | |
| 21 | | at info[AT]civicrm[DOT]org. If you have questions about the | |
| 22 | | GNU Affero General Public License or the licensing of CiviCRM, | |
| 23 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | |
| 24 | +--------------------------------------------------------------------+ |
| 25 | *} |
| 26 | {* Relationship tab within View Contact - browse, and view relationships for a contact *} |
| 27 | {if $action neq 16} {* add, update or view *} |
| 28 | {include file="CRM/Contact/Form/Relationship.tpl"} |
| 29 | {else} |
| 30 | <div id="contact-summary-relationship-tab" class="view-content"> |
| 31 | {if $permission EQ 'edit'} |
| 32 | <div class="action-link"> |
| 33 | {crmButton accesskey="N" p='civicrm/contact/view/rel' q="cid=`$contactId`&action=add&reset=1" icon="circle-plus"}{ts}Add Relationship{/ts}{/crmButton} |
| 34 | </div> |
| 35 | {/if} |
| 36 | |
| 37 | {* display current relationships *} |
| 38 | <h3>{ts}Current Relationships{/ts}</h3> |
| 39 | {include file="CRM/Contact/Page/View/RelationshipSelector.tpl" context="current"} |
| 40 | <div id="permission-legend" class="crm-content-block"> |
| 41 | <span class="crm-marker">* </span> |
| 42 | {ts}Indicates a permissioned relationship. This contact can be viewed and updated by the other.{/ts} |
| 43 | </div> |
| 44 | |
| 45 | <div class="spacer"></div> |
| 46 | <p></p> |
| 47 | {* display past relationships *} |
| 48 | <div class="label font-red">{ts}Inactive Relationships{/ts}</div> |
| 49 | <div class="description">{ts}These relationships are Disabled OR have a past End Date.{/ts}</div> |
| 50 | {include file="CRM/Contact/Page/View/RelationshipSelector.tpl" context="past"} |
| 51 | </div> |
| 52 | |
| 53 | {include file="CRM/common/enableDisableApi.tpl"} |
| 54 | {literal} |
| 55 | <script type="text/javascript"> |
| 56 | CRM.$(function($) { |
| 57 | // Changing relationships may affect related members and contributions. Ensure they are refreshed. |
| 58 | $('#contact-summary-relationship-tab').on('crmPopupFormSuccess', function() { |
| 59 | CRM.tabHeader.resetTab('#tab_contribute'); |
| 60 | CRM.tabHeader.resetTab('#tab_member'); |
| 61 | }); |
| 62 | }); |
| 63 | </script> |
| 64 | {/literal} |
| 65 | {/if} {* close of custom data else*} |
| 66 | |