Merge pull request #17916 from colemanw/domainCache
[civicrm-core.git] / templates / CRM / Activity / Form / ActivityLinks.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 {* Links for scheduling/logging meetings and calls and Sending Email *}
11
12 {if $contact_id }
13 {assign var = "contactId" value= $contact_id }
14 {/if}
15
16 {if $as_select} {* on 3.2, the activities can be either a drop down select (on the activity tab) or a list (on the action menu) *}
17 <select name="other_activity" class="crm-form-select crm-select2 crm-action-menu fa-plus">
18 <option value="">{ts}New Activity{/ts}</option>
19 {foreach from=$activityTypes item=act}
20 <option value="{$act.url}" data-icon="{$act.icon}">{$act.label}</option>
21 {/foreach}
22 </select>
23 {literal}
24 <script type="text/javascript">
25 CRM.$(function($) {
26 $('[name=other_activity].crm-action-menu').change(function() {
27 var
28 $el = $(this),
29 url = $el.val();
30 if (url) {
31 $el.select2('val', '');
32 CRM.loadForm(url).on('crmFormSuccess', function() {
33 CRM.refreshParent($el);
34 });
35 }
36 });
37 });
38 </script>
39 {/literal}
40 {else}
41 <ul>
42 <li class="crm-activity-tab"><a href="#" data-tab="activity">{ts}Record Activity:{/ts}</a></li>
43 {foreach from=$activityTypes key=k item=act}
44 <li class="crm-activity-type_{$k}">
45 <a href="{$act.url}" data-tab="activity">
46 <i class="crm-i {$act.icon}" aria-hidden="true"></i> {$act.label}
47 </a>
48 </li>
49 {/foreach}
50
51 {* add hook links if any *}
52 {if $hookLinks}
53 {foreach from=$hookLinks item=link}
54 <li>
55 <a href="{$link.url}" data-tab="activity"{if !empty($link.title)} title="{$link.title|escape}"{/if}
56 {if !empty($link.class)} class="{$link.class}"{/if}>
57 {if $link.img}
58 <img src="{$link.img}" alt="{$link.title|escape}" />&nbsp;
59 {/if}
60 {$link.name}
61 </a>
62 </li>
63 {/foreach}
64 {/if}
65
66 </ul>
67
68 {/if}