{* +--------------------------------------------------------------------+ | CiviCRM version 4.4 | +--------------------------------------------------------------------+ | Copyright CiviCRM LLC (c) 2004-2013 | +--------------------------------------------------------------------+ | This file is a part of CiviCRM. | | | | CiviCRM is free software; you can copy, modify, and distribute it | | under the terms of the GNU Affero General Public License | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | | | CiviCRM is distributed in the hope that it will be useful, but | | WITHOUT ANY WARRANTY; without even the implied warranty of | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | See the GNU Affero General Public License for more details. | | | | You should have received a copy of the GNU Affero General Public | | License and the CiviCRM Licensing Exception along | | with this program; if not, contact CiviCRM LLC | | at info[AT]civicrm[DOT]org. If you have questions about the | | GNU Affero General Public License or the licensing of CiviCRM, | | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ *} {* Relationship tab within View Contact - browse, and view relationships for a contact *} {if !empty($cdType) } {include file="CRM/Custom/Form/CustomData.tpl"} {elseif $action neq 16} {* add, update or view *} {include file="CRM/Contact/Form/Relationship.tpl"} {else}
{if $permission EQ 'edit'} {/if} {include file="CRM/common/jsortable.tpl" useAjax=0} {* start of code to show current relationships *} {if $currentRelationships} {* show browse table for any action *}
{if $relationshipTabContext} {*to show the title and links only when viewed from relationship tab, not from dashboard*}

{ts}Current Relationships{/ts}

{/if} {strip} {foreach from=$currentRelationships item=rel} {*assign var = "rtype" value = "" } {if $rel.contact_a eq $contactId } {assign var = "rtype" value = "a_b" } {else} {assign var = "rtype" value = "b_a" } {/if*} {if $relationshipTabContext} {else} {/if} {/foreach}
{ts}Relationship{/ts} {ts}Start{/ts} {ts}End{/ts} {ts}City{/ts} {ts}State/Prov{/ts} {ts}Email{/ts} {ts}Phone{/ts}
{$rel.relation} {if ($rel.cid eq $rel.contact_id_a and $rel.is_permission_a_b eq 1) OR ($rel.cid eq $rel.contact_id_b and $rel.is_permission_b_a eq 1) } * {/if} {if $rel.description}

{$rel.description}

{/if}
{$rel.name} {if ($contactId eq $rel.contact_id_a and $rel.is_permission_a_b eq 1) OR ($contactId eq $rel.contact_id_b and $rel.is_permission_b_a eq 1) } * {/if} {$rel.relation} {$rel.name}{$rel.start_date} {$rel.end_date} {$rel.city} {$rel.state} {$rel.email} {$rel.phone} {$rel.action|replace:'xx':$rel.id} {$rel.start_date|crmDate} {$rel.end_date|crmDate}
{/strip}
{if $relationshipTabContext}
* {ts}Indicates a permissioned relationship. This contact can be viewed and updated by the other.{/ts}
{/if} {/if} {* end of code to show current relationships *} {if $currentRelationships or $inactiveRelationships} {include file="CRM/common/enableDisableApi.tpl"} {else}
{capture assign=link}accesskey="N" class="action-item action-item-first" href="{crmURL p='civicrm/contact/view/rel' q="cid=`$contactId`&action=add&reset=1"}"{/capture} {if $permission EQ 'edit'} {ts 1=$link}There are no Relationships entered for this contact. You can add one.{/ts} {elseif ! $relationshipTabContext} {ts}There are no related contacts / organizations on record for you.{/ts} {else} {ts}There are no Relationships entered for this contact.{/ts} {/if}
{/if}
{* start of code to show inactive relationships *} {if $inactiveRelationships} {* show browse table for any action *}

{ts}Inactive Relationships{/ts}
{ts}These relationships are Disabled OR have a past End Date.{/ts}
{strip} {foreach from=$inactiveRelationships item=rel} {assign var = "rtype" value = "" } {if $rel.contact_a > 0 } {assign var = "rtype" value = "b_a" } {else} {assign var = "rtype" value = "a_b" } {/if} {/foreach}
{ts}Relationship{/ts} {ts}Start{/ts} {ts}End{/ts} {ts}City{/ts} {ts}State/Prov{/ts} {ts}Email{/ts} {ts}Phone{/ts}
{$rel.relation} {if $rel.description}

{$rel.description}

{/if}
{$rel.name} {$rel.start_date} {$rel.end_date} {$rel.city} {$rel.state} {$rel.email} {$rel.phone} {$rel.action|replace:'xx':$rel.id} {$rel.start_date|crmDate} {$rel.end_date|crmDate}
{/strip}
{/if} {* end of code to show inactive relationships *}
{/if} {* close of custom data else*} {if !empty($searchRows) } {*include custom data js file*} {include file="CRM/common/customData.tpl"} {/if}