Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
2c4c49ca | 3 | | CiviCRM version 4.7 | |
6a488035 | 4 | +--------------------------------------------------------------------+ |
e7112fa7 | 5 | | Copyright CiviCRM LLC (c) 2004-2015 | |
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 | *} | |
6dac2504 T |
26 | {literal} |
27 | <style> | |
28 | #tagtree .highlighted > span { | |
29 | background-color: #fefca6; | |
30 | } | |
31 | #tagtree .helpicon ins { | |
32 | display: none; | |
33 | } | |
34 | #tagtree ins.jstree-icon { | |
35 | cursor: pointer; | |
36 | } | |
37 | </style> | |
38 | <script type="text/javascript"> | |
39 | (function($, _){{/literal} | |
4a679824 | 40 | var entityID='{$entityID}', |
6dac2504 T |
41 | entityTable='{$entityTable}', |
42 | $form = $('form.{$form.formClass}'); | |
43 | {literal} | |
44 | ||
45 | $(function() { | |
46 | function highlightSelected() { | |
47 | $("ul input:not(:checked)", '#tagtree').each(function () { | |
48 | $(this).closest("li").removeClass('highlighted'); | |
49 | }); | |
50 | $("ul input:checked", '#tagtree').each(function () { | |
51 | $(this).parents("li[id^=tag]").addClass('highlighted'); | |
52 | }); | |
53 | } | |
54 | highlightSelected(); | |
55 | ||
56 | $("#tagtree input").change(function(){ | |
57 | highlightSelected(); | |
58 | }); | |
59 | ||
984bbb64 | 60 | var childTag = "{/literal}{$loadjsTree}{literal}"; |
d768b780 WA |
61 | if (childTag) { |
62 | //load js tree. | |
63 | $("#tagtree").jstree({ | |
64 | plugins : ["themes", "html_data"], | |
65 | themes: { | |
66 | "theme": 'classic', | |
67 | "dots": false, | |
68 | "icons": false, | |
69 | "url": CRM.config.resourceBase + 'packages/jquery/plugins/jstree/themes/classic/style.css' | |
70 | } | |
71 | }); | |
72 | } | |
6dac2504 | 73 | {/literal} |
4a679824 | 74 | {if !empty($permission) && $permission neq 'edit'} |
6dac2504 T |
75 | {literal} |
76 | $("#tagtree input").prop('disabled', true); | |
77 | {/literal} | |
78 | {/if} | |
79 | {literal} | |
80 | }); | |
81 | })(CRM.$, CRM._); | |
82 | {/literal} | |
83 | </script> | |
84 | ||
6a488035 TO |
85 | {if $title} |
86 | <div class="crm-accordion-wrapper crm-tagGroup-accordion collapsed"> | |
4cb067fe | 87 | <div class="crm-accordion-header">{$title}</div> |
6a488035 TO |
88 | <div class="crm-accordion-body" id="tagGroup"> |
89 | {/if} | |
90 | <table class="form-layout-compressed{if $context EQ 'profile'} crm-profile-tagsandgroups{/if}"> | |
4cb067fe | 91 | <tr> |
4a679824 | 92 | {if !$type || $type eq 'group'} |
93 | <td> | |
94 | {if $groupElementType eq 'select'} | |
95 | <span class="label">{if $title}{$form.group.label}{/if}</span> | |
96 | {/if} | |
c18f95b7 | 97 | {$form.group.html} |
4bb8711e | 98 | </td> |
4a679824 | 99 | {/if} |
b910dc48 | 100 | {if (!$type || $type eq 'tag') && $tree} |
d768b780 WA |
101 | <td width="70%">{if $title}<span class="label">{$form.tag.label}</span>{/if} |
102 | <div id="tagtree"> | |
103 | {include file="CRM/Contact/Form/Edit/Tagtree.tpl" level=1} | |
104 | </div> | |
105 | </td> | |
106 | <tr><td>{include file="CRM/common/Tagset.tpl"}</td></tr> | |
107 | {/if} | |
4a679824 | 108 | </tr> |
d768b780 | 109 | </table> |
6a488035 | 110 | {if $title} |
4cb067fe | 111 | </div> |
6a488035 | 112 | </div><!-- /.crm-accordion-wrapper --> |
6a488035 | 113 | {/if} |