Merge pull request #23227 from eileenmcnaughton/inbetween_4
[civicrm-core.git] / templates / CRM / Admin / Page / RelationshipType.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
4 | |
5 | This work is published under the GNU AGPLv3 license with some |
6 | permitted exceptions and without any warranty. For full license |
7 | and copyright information, see https://civicrm.org/licensing |
8 +--------------------------------------------------------------------+
9 *}
10 {capture assign=customURL}{crmURL p='civicrm/admin/custom/group' q="reset=1"}{/capture}
11 {capture assign=docLink}{docURL page="user/organising-your-data/relationships"}{/capture}
12
13 {if $action eq 1 or $action eq 2 or $action eq 4 or $action eq 8}
14 {include file="CRM/Admin/Form/RelationshipType.tpl"}
15 {else}
16 <div class="help">
17 <p>{ts}Relationship types describe relationships between people, households and organizations. Relationship types labels describe the relationship from the perspective of each of the two entities (e.g. Parent &gt;-&lt; Child, Employer &gt;-&lt; Employee). For some types of relationships, the labels may be the same in both directions (e.g. Spouse &gt;-&lt; Spouse).{/ts} {$docLink}</p>
18 <p>{ts 1=$customURL}You can define as many additional relationships types as needed to cover the types of relationships you want to track. Once a relationship type is created, you may also define custom fields to extend relationship information for that type from <a href='%1'>Administer CiviCRM &raquo; Custom Data</a>.{/ts}{help id='id-relationship-types'} </p>
19 </div>
20
21 <div class="crm-content-block crm-block">
22 {if $rows}
23 {if !($action eq 1 and $action eq 2)}
24 <div class="action-link">
25 {crmButton q="action=add&reset=1" class="newRelationshipType" icon="plus-circle"}{ts}Add Relationship Type{/ts}{/crmButton}
26 </div>
27 {/if}
28
29 <div id="ltype">
30
31 {strip}
32 {* handle enable/disable actions*}
33 {include file="CRM/common/enableDisableApi.tpl"}
34 {include file="CRM/common/jsortable.tpl"}
35 <table id="options" class="display">
36 <thead>
37 <tr>
38 <th id="sortable">{ts}Relationship A to B{/ts}</th>
39 <th>{ts}Relationship B to A{/ts}</th>
40 <th>{ts}Contact Type A{/ts}</th>
41 <th>{ts}Contact Type B{/ts}</th>
42 <th>{ts}Enabled?{/ts}</th>
43 <th></th>
44 </tr>
45 </thead>
46 {foreach from=$rows item=row}
47 <tr id="relationship_type-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"}{if !empty($row.class)} {$row.class}{/if}{if NOT $row.is_active} disabled{/if} crm-relationship">
48 <td class="crm-relationship-label_a_b crm-editable" data-field="label_a_b">{$row.label_a_b}</td>
49 <td class="crm-relationship-label_b_a crm-editable" data-field="label_b_a">{$row.label_b_a}</td>
50 <td class="crm-relationship-contact_type_a_display">
51 {if $row.contact_type_a_display} {$row.contact_type_a_display}
52 {if !empty($row.contact_sub_type_a)} - {$row.contact_sub_type_a} {/if}{else} {ts}All Contacts{/ts} {/if} </td>
53 <td class="crm-relationship-contact_type_b_display">
54 {if $row.contact_type_b_display} {$row.contact_type_b_display}
55 {if !empty($row.contact_sub_type_b)} - {$row.contact_sub_type_b}{/if} {else} {ts}All Contacts{/ts} {/if} </td>
56 <td class="crm-relationship-is_active" id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
57 <td>{$row.action|smarty:nodefaults|replace:'xx':$row.id}</td>
58 </tr>
59 {/foreach}
60 </table>
61 {/strip}
62
63 </div>
64 {else}
65 <div class="messages status no-popup">
66 <img src="{$config->resourceBase}i/Inform.gif" alt="{ts}status{/ts}"/>
67 {ts}None found.{/ts}
68 </div>
69 {/if}
70 <div class="action-link">
71 {crmButton q="action=add&reset=1" class="newRelationshipType" icon="plus-circle"}{ts}Add Relationship Type{/ts}{/crmButton}
72 {crmButton p="civicrm/admin" q="reset=1" class="cancel" icon="times"}{ts}Done{/ts}{/crmButton}
73 </div>
74 {/if}
75 </div>