Commit | Line | Data |
---|---|---|
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 | {* Links for scheduling/logging meetings and calls and Sending Email *} | |
39082712 | 27 | |
6a488035 TO |
28 | {if $contact_id } |
29 | {assign var = "contactId" value= $contact_id } | |
30 | {/if} | |
31 | ||
32 | {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 | 33 | <select name="other_activity" class="crm-form-select crm-select2 crm-action-menu fa-plus"> |
1eae8b7a | 34 | <option value="">{ts}New Activity{/ts}</option> |
00c2ff9e CW |
35 | {foreach from=$activityTypes item=act} |
36 | <option value="{$act.url}" data-icon="{$act.icon}">{$act.label}</option> | |
6a488035 TO |
37 | {/foreach} |
38 | </select> | |
23223213 CW |
39 | {literal} |
40 | <script type="text/javascript"> | |
3cc60a06 | 41 | CRM.$(function($) { |
982ba75d | 42 | $('[name=other_activity].crm-action-menu').change(function() { |
23223213 CW |
43 | var |
44 | $el = $(this), | |
45 | url = $el.val(); | |
46 | if (url) { | |
982ba75d | 47 | $el.select2('val', ''); |
23223213 | 48 | CRM.loadForm(url).on('crmFormSuccess', function() { |
554b1768 | 49 | CRM.refreshParent($el); |
23223213 CW |
50 | }); |
51 | } | |
52 | }); | |
53 | }); | |
54 | </script> | |
55 | {/literal} | |
6a488035 TO |
56 | {else} |
57 | <ul> | |
a10432db | 58 | <li class="crm-activity-tab"><a href="#" data-tab="activity">{ts}Record Activity:{/ts}</a></li> |
00c2ff9e CW |
59 | {foreach from=$activityTypes key=k item=act} |
60 | <li class="crm-activity-type_{$k}"> | |
61 | <a href="{$act.url}" data-tab="activity"> | |
62 | <i class="crm-i {$act.icon}"></i> {$act.label} | |
63 | </a> | |
64 | </li> | |
6a488035 TO |
65 | {/foreach} |
66 | ||
67 | {* add hook links if any *} | |
68 | {if $hookLinks} | |
69 | {foreach from=$hookLinks item=link} | |
70 | <li> | |
f03ef825 | 71 | <a href="{$link.url}" data-tab="activity"{if !empty($link.title)} title="{$link.title|escape}"{/if} |
ede89125 | 72 | {if !empty($link.class)} class="{$link.class}"{/if}> |
6a488035 | 73 | {if $link.img} |
f03ef825 | 74 | <img src="{$link.img}" alt="{$link.title|escape}" /> |
6a488035 | 75 | {/if} |
a9b15f31 | 76 | {$link.name} |
6a488035 TO |
77 | </a> |
78 | </li> | |
79 | {/foreach} | |
80 | {/if} | |
81 | ||
82 | </ul> | |
83 | ||
84 | {/if} |