2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.4 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2013 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
26 {* Relationship tab within View Contact - browse, and view relationships for a contact *}
28 {include file="CRM/Custom/Form/CustomData.tpl"}
29 {elseif $action neq 16} {* add, update or view *}
30 {include file="CRM/Contact/Form/Relationship.tpl"}
32 <div class="view-content">
33 <div class="crm-block crm-content-block">
34 {if $permission EQ 'edit'}
35 <div class="action-link">
36 <a accesskey="N" href="{crmURL p='civicrm/contact/view/rel' q="cid=`$contactId`&action=add&reset=1"}" class="button"><span><div class="icon add-icon"></div>{ts}Add Relationship{/ts}</span></a>
39 {include file="CRM/common/jsortable.tpl" useAjax=0}
40 {* start of code to show current relationships *}
41 {if $currentRelationships}
42 {* show browse table for any action *}
43 <div id="current-relationships">
44 {if $relationshipTabContext} {*to show the title and links only when viewed from relationship tab, not from dashboard*}
45 <h3>{ts}Current Relationships{/ts}</h3>
48 <table id="current_relationship" class="display">
51 <th>{ts}Relationship{/ts}</th>
53 <th id="start_date">{ts}Start{/ts}</th>
54 <th id="end_date">{ts}End{/ts}</th>
55 <th>{ts}City{/ts}</th>
56 <th>{ts}State/Prov{/ts}</th>
57 <th>{ts}Email{/ts}</th>
58 <th>{ts}Phone{/ts}</th>
60 <th class="hiddenElement"></th>
61 <th class="hiddenElement"></th>
64 {foreach from=$currentRelationships item=rel}
65 {*assign var = "rtype" value = "" }
66 {if $rel.contact_a eq $contactId }
67 {assign var = "rtype" value = "a_b" }
69 {assign var = "rtype" value = "b_a" }
72 <tr id="relationship-{$rel.id}" class="crm-entity {cycle values="odd-row,even-row"} row-relationship {if $rel.is_permission_a_b eq 1 or $rel.is_permission_b_a eq 1}row-highlight{/if}">
74 {if $relationshipTabContext}
76 <a href="{crmURL p='civicrm/contact/view/rel' q="action=view&reset=1&selectedChild=rel&cid=`$contactId`&id=`$rel.id`&rtype=`$rel.rtype`"}">{$rel.relation}</a>
77 {if ($rel.cid eq $rel.contact_id_a and $rel.is_permission_a_b eq 1) OR
78 ($rel.cid eq $rel.contact_id_b and $rel.is_permission_b_a eq 1) }
79 <span id="permission-b-a" class="crm-marker permission-relationship"> *</span>
81 {if $rel.description}<p class='description'>{$rel.description}</p>{/if}
84 <a href="{crmURL p='civicrm/contact/view' q="action=view&reset=1&cid=`$rel.cid`"}">{$rel.name}</a>
85 {if ($contactId eq $rel.contact_id_a and $rel.is_permission_a_b eq 1) OR
86 ($contactId eq $rel.contact_id_b and $rel.is_permission_b_a eq 1) }
87 <span id="permission-a-b" class="crm-marker permission-relationship"> *</span>
91 <td class="bold">{$rel.relation}</strong></td>
94 <td class="crm-rel-start_date">{$rel.start_date}</td>
95 <td class="crm-rel-end_date">{$rel.end_date}</td>
100 <td class="nowrap">{$rel.action|replace:'xx':$rel.id}</td>
101 <td class="start_date hiddenElement">{$rel.start_date|crmDate}</td>
102 <td class="end_date hiddenElement">{$rel.end_date|crmDate}</td>
109 {if $relationshipTabContext}
110 <div id="permission-legend" class="crm-content-block">
111 <span class="crm-marker">* </span>{ts}Indicates a permissioned relationship. This contact can be viewed and updated by the other.{/ts}
115 {* end of code to show current relationships *}
117 {if $currentRelationships or $inactiveRelationships}
118 {include file="CRM/common/enableDisableApi.tpl"}
120 <div class="messages status no-popup">
121 <div class="icon inform-icon"></div>
122 {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}
123 {if $permission EQ 'edit'}
124 {ts 1=$link}There are no Relationships entered for this contact. You can <a %1>add one</a>.{/ts}
125 {elseif ! $relationshipTabContext}
126 {ts}There are no related contacts / organizations on record for you.{/ts}
128 {ts}There are no Relationships entered for this contact.{/ts}
133 <div class="spacer"></div>
135 {* start of code to show inactive relationships *}
136 {if $inactiveRelationships}
137 {* show browse table for any action *}
138 <div id="inactive-relationships">
140 <div class="label font-red">{ts}Inactive Relationships{/ts}</div>
141 <div class="description">{ts}These relationships are Disabled OR have a past End Date.{/ts}</div>
143 <table id="inactive_relationship" class="display">
146 <th>{ts}Relationship{/ts}</th>
148 <th id="dis-start_date">{ts}Start{/ts}</th>
149 <th id="dis-end_date">{ts}End{/ts}</th>
150 <th>{ts}City{/ts}</th>
151 <th>{ts}State/Prov{/ts}</th>
152 <th>{ts}Email{/ts}</th>
153 <th>{ts}Phone{/ts}</th>
155 <th class="hiddenElement"></th>
156 <th class="hiddenElement"></th>
159 {foreach from=$inactiveRelationships item=rel}
160 {assign var = "rtype" value = "" }
161 {if $rel.contact_a > 0 }
162 {assign var = "rtype" value = "b_a" }
164 {assign var = "rtype" value = "a_b" }
166 <tr id="relationship-{$rel.id}" class="crm-entity {cycle values="odd-row,even-row"}">
169 {if $rel.description}<p class='description'>{$rel.description}</p>{/if}
171 <td><a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=`$rel.cid`"}">{$rel.name}</a></td>
172 <td class="dis-crm-rel-start_date">{$rel.start_date}</td>
173 <td class="dis-crm-rel-end_date">{$rel.end_date}</td>
175 <td>{$rel.state}</td>
176 <td>{$rel.email}</td>
177 <td>{$rel.phone}</td>
178 <td class="nowrap">{$rel.action|replace:'xx':$rel.id}</td>
179 <td class="dis-start_date hiddenElement">{$rel.start_date|crmDate}</td>
180 <td class="dis-end_date hiddenElement">{$rel.end_date|crmDate}</td>
188 {* end of code to show inactive relationships *}
192 {/if} {* close of custom data else*}
194 {if !empty($searchRows) }
195 {*include custom data js file*}
196 {include file="CRM/common/customData.tpl"}