Merge pull request #17655 from samuelsov/lab1827
[civicrm-core.git] / templates / CRM / Activity / Form / ActivityLinks.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
1188c7a8 3 | Copyright CiviCRM LLC. All rights reserved. |
6a488035 4 | |
1188c7a8
TO
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 |
6a488035
TO
8 +--------------------------------------------------------------------+
9*}
10{* Links for scheduling/logging meetings and calls and Sending Email *}
39082712 11
6a488035
TO
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) *}
9597c394 17<select name="other_activity" class="crm-form-select crm-select2 crm-action-menu fa-plus">
1eae8b7a 18 <option value="">{ts}New Activity{/ts}</option>
00c2ff9e
CW
19{foreach from=$activityTypes item=act}
20 <option value="{$act.url}" data-icon="{$act.icon}">{$act.label}</option>
6a488035
TO
21{/foreach}
22</select>
23223213
CW
23{literal}
24<script type="text/javascript">
3cc60a06 25 CRM.$(function($) {
982ba75d 26 $('[name=other_activity].crm-action-menu').change(function() {
23223213
CW
27 var
28 $el = $(this),
29 url = $el.val();
30 if (url) {
982ba75d 31 $el.select2('val', '');
23223213 32 CRM.loadForm(url).on('crmFormSuccess', function() {
554b1768 33 CRM.refreshParent($el);
23223213
CW
34 });
35 }
36 });
37 });
38</script>
39{/literal}
6a488035
TO
40{else}
41<ul>
a10432db 42 <li class="crm-activity-tab"><a href="#" data-tab="activity">{ts}Record Activity:{/ts}</a></li>
00c2ff9e
CW
43{foreach from=$activityTypes key=k item=act}
44<li class="crm-activity-type_{$k}">
45 <a href="{$act.url}" data-tab="activity">
13a3d214 46 <i class="crm-i {$act.icon}" aria-hidden="true"></i> {$act.label}
00c2ff9e
CW
47 </a>
48</li>
6a488035
TO
49{/foreach}
50
51{* add hook links if any *}
52{if $hookLinks}
53 {foreach from=$hookLinks item=link}
54 <li>
f03ef825 55 <a href="{$link.url}" data-tab="activity"{if !empty($link.title)} title="{$link.title|escape}"{/if}
ede89125 56 {if !empty($link.class)} class="{$link.class}"{/if}>
6a488035 57 {if $link.img}
f03ef825 58 <img src="{$link.img}" alt="{$link.title|escape}" />&nbsp;
6a488035 59 {/if}
a9b15f31 60 {$link.name}
6a488035
TO
61 </a>
62 </li>
63 {/foreach}
64{/if}
65
66</ul>
67
68{/if}