Commit | Line | Data |
---|---|---|
7f254ad8 AE |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
3 | | CiviCRM version 4.6 | | |
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 | {capture assign=customURL}{crmURL p='civicrm/admin/custom/group' q="reset=1"}{/capture} | |
27 | {capture assign=docLink}{docURL page="user/organising-your-data/relationships"}{/capture} | |
28 | ||
29 | {if $action eq 1 or $action eq 2 or $action eq 4 or $action eq 8} | |
30 | {include file="CRM/Admin/Form/RelationshipType.tpl"} | |
31 | {else} | |
32 | <div id="help"> | |
33 | <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 >-< Child, Employer >-< Employee). For some types of relationships, the labels may be the same in both directions (e.g. Spouse >-< Spouse).{/ts} {$docLink}</p> | |
34 | <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 » Custom Data</a>.{/ts}{help id='id-relationship-types'} </p> | |
35 | </div> | |
36 | {if $rows} | |
37 | {if !($action eq 1 and $action eq 2)} | |
38 | <div class="action-link"> | |
39 | {crmButton q="action=add&reset=1" class="newRelationshipType" icon="circle-plus"}{ts}Add Relationship Type{/ts}{/crmButton} | |
40 | </div> | |
41 | {/if} | |
42 | ||
43 | <div id="ltype"> | |
44 | ||
45 | {strip} | |
46 | {* handle enable/disable actions*} | |
47 | {include file="CRM/common/enableDisableApi.tpl"} | |
48 | {include file="CRM/common/jsortable.tpl"} | |
49 | <table id="options" class="display"> | |
50 | <thead> | |
51 | <tr> | |
52 | <th id="sortable">{ts}Relationship A to B{/ts}</th> | |
53 | <th>{ts}Relationship B to A{/ts}</th> | |
54 | <th>{ts}Contact Type A{/ts}</th> | |
55 | <th>{ts}Contact Type B{/ts}</th> | |
56 | <th>{ts}Enabled?{/ts}</th> | |
57 | <th></th> | |
58 | </tr> | |
59 | </thead> | |
60 | {foreach from=$rows item=row} | |
61 | <tr id="relationship_type-{$row.id}" class="crm-entity {cycle values="odd-row,even-row"} {$row.class}{if NOT $row.is_active} disabled{/if} crm-relationship"> | |
62 | <td class="crm-relationship-label_a_b crm-editable" data-field="label_a_b">{$row.label_a_b}</td> | |
63 | <td class="crm-relationship-label_b_a crm-editable" data-field="label_b_a">{$row.label_b_a}</td> | |
64 | <td class="crm-relationship-contact_type_a_display"> | |
65 | {if $row.contact_type_a_display} {$row.contact_type_a_display} | |
66 | {if $row.contact_sub_type_a} - {$row.contact_sub_type_a} {/if}{else} {ts}All Contacts{/ts} {/if} </td> | |
67 | <td class="crm-relationship-contact_type_b_display"> | |
68 | {if $row.contact_type_b_display} {$row.contact_type_b_display} | |
69 | {if $row.contact_sub_type_b} - {$row.contact_sub_type_b}{/if} {else} {ts}All Contacts{/ts} {/if} </td> | |
70 | <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> | |
71 | <td>{$row.action|replace:'xx':$row.id}</td> | |
72 | </tr> | |
73 | {/foreach} | |
74 | </table> | |
75 | {/strip} | |
76 | ||
77 | </div> | |
78 | {else} | |
79 | <div class="messages status no-popup"> | |
80 | <img src="{$config->resourceBase}i/Inform.gif" alt="{ts}status{/ts}"/> | |
81 | {ts}None found.{/ts} | |
82 | </div> | |
83 | {/if} | |
84 | <div class="action-link"> | |
85 | {crmButton q="action=add&reset=1" class="newRelationshipType" icon="circle-plus"}{ts}Add Relationship Type{/ts}{/crmButton} | |
86 | {crmButton p="civicrm/admin" q="reset=1" class="cancel" icon="close"}{ts}Done{/ts}{/crmButton} | |
87 | </div> | |
88 | {/if} |