{*
+--------------------------------------------------------------------+
| CiviCRM version 4.3 |
+--------------------------------------------------------------------+
| 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"}
{else}
{if $action eq 1 or $action eq 2 or $action eq 4 or $action eq 8} {* add, update or view *}
{include file="CRM/Contact/Form/Relationship.tpl"}
{/if}
{if $action NEQ 1 AND $action NEQ 2 AND $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}
{ts}Relationship{/ts} |
|
{ts}Start{/ts} |
{ts}End{/ts} |
{ts}City{/ts} |
{ts}State/Prov{/ts} |
{ts}Email{/ts} |
{ts}Phone{/ts} |
|
|
|
{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}
{$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}
|
{$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}
|
{else}
{$rel.relation} |
{$rel.name} |
{/if}
{$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} |
{/foreach}
{/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 NOT ($currentRelationships or $inactiveRelationships) }
{if $action NEQ 1} {* show 'no relationships' message - unless already in 'add' mode. *}
{/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}
{ts}Relationship{/ts} |
|
{ts}City{/ts} |
{ts}State/Prov{/ts} |
{ts}Phone{/ts} |
{ts}End Date{/ts} |
|
|
{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}
{$rel.relation} |
{$rel.name} |
{$rel.city} |
{$rel.state} |
{$rel.phone} |
{$rel.end_date} |
{$rel.action|replace:'xx':$rel.id} |
{$rel.end_date|crmDate} |
{/foreach}
{/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}