Merge pull request #1 from civicrm/master
[civicrm-core.git] / templates / CRM / Tag / Form / Edit.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
fee14197 3 | CiviCRM version 5 |
6a488035 4 +--------------------------------------------------------------------+
6b83d5bd 5 | Copyright CiviCRM LLC (c) 2004-2019 |
6a488035
TO
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{* this template is used for adding/editing a tag (admin) *}
6a488035 27<div class="crm-block crm-form-block crm-tag-form-block">
69582599 28 {if $action eq 1 or $action eq 2 }
6a488035
TO
29 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
30 <table class="form-layout-compressed">
31 <tr class="crm-tag-form-block-label">
32 <td class="label">{$form.name.label}</td>
33 <td>{$form.name.html}</td>
34 </tr>
35 <tr class="crm-tag-form-block-description">
36 <td class="label">{$form.description.label}</td>
37 <td>{$form.description.html}</td>
38 </tr>
39 {if $form.parent_id.html}
40 <tr class="crm-tag-form-block-parent_id">
69582599
DG
41 <td class="label">{$form.parent_id.label}</td>
42 <td>{$form.parent_id.html}</td>
6a488035
TO
43 </tr>
44 {/if}
d3cbd0a5 45 {if $form.used_for}
6a488035
TO
46 <tr class="crm-tag-form-block-used_for">
47 <td class="label">{$form.used_for.label}</td>
69582599
DG
48 <td>{$form.used_for.html} <br />
49 <span class="description">
50 {if $is_parent}{ts}You can change the types of records which this tag can be used for by editing the 'Parent' tag.{/ts}
51 {else}{ts}What types of record(s) can this tag be used for?{/ts}
52 {/if}
53 </span>
6a488035
TO
54 </td>
55 </tr>
d3cbd0a5 56 {/if}
1192bd09
CW
57 {if $form.color.html}
58 <tr class="crm-tag-form-block-color">
59 <td class="label">{$form.color.label}</td>
60 <td>{$form.color.html}</td>
61 </tr>
62 {/if}
6a488035
TO
63 <tr class="crm-tag-form-block-is_reserved">
64 <td class="label">{$form.is_reserved.label}</td>
65 <td>{$form.is_reserved.html} <br /><span class="description">{ts}Reserved tags can not be deleted. Users with 'administer reserved tags' permission can set or unset the reserved flag. You must uncheck 'Reserved' (and delete any child tags) before you can delete a tag.{/ts}
66 </td>
67 </tr>
69582599
DG
68 {if ! $isTagSet} {* Tagsets are not selectable by definition, so exclude this field for tagsets *}
69 <tr class="crm-tag-form-block-is_slectable">
70 <td class="label">{$form.is_selectable.label}</td>
71 <td>{$form.is_selectable.html}<br /><span class="description">{ts}Defines if you can select this tag.{/ts}
72 </td>
73 </tr>
74 {/if}
6a488035
TO
75 </table>
76 {if $parent_tags|@count > 0}
77 <table class="form-layout-compressed">
78 <tr><td><label>{ts}Remove Parent?{/ts}</label></td></tr>
79 {foreach from=$parent_tags item=ctag key=tag_id}
80 {assign var="element_name" value="remove_parent_tag_"|cat:$tag_id}
81 <tr><td>&nbsp;&nbsp;{$form.$element_name.html}&nbsp;{$form.$element_name.label}</td></tr>
82 {/foreach}
83 </table><br />
84 {/if}
85 {else}
d3cbd0a5 86 <div class="status">{ts 1=$delName}Are you sure you want to delete <b>%1</b>?{/ts}<br />{ts}This tag will be removed from any currently tagged contacts, and users will no longer be able to assign contacts to this tag.{/ts}</div>
6a488035
TO
87 {/if}
88 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
89</div>
6bed6964
CW
90{literal}
91<script type="text/javascript">
92 CRM.$(function($) {
93 var $form = $('form.{/literal}{$form.formClass}{literal}');
94 function toggleUsedFor() {
d3cbd0a5
CW
95 var value = $(this).val() && $(this).val() !== '0';
96 $('.crm-tag-form-block-used_for', $form).toggle(!value);
97 if (value) {
6bed6964
CW
98 $('select#used_for', $form).val('').change();
99 }
100 }
101 $('input[name=parent_id]', $form).change(toggleUsedFor).each(toggleUsedFor);
102 });
103</script>
104{/literal}