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 | {* this template is used for adding/editing other (custom) activities. *} | |
6a488035 TO |
27 | {if $action eq 4} |
28 | <div class="crm-block crm-content-block crm-activity-view-block"> | |
29 | {else} | |
6a488035 TO |
30 | {if $activityTypeDescription } |
31 | <div class="help">{$activityTypeDescription}</div> | |
32 | {/if} | |
33 | <div class="crm-block crm-form-block crm-activity-form-block"> | |
34 | {/if} | |
35 | {* added onload javascript for source contact*} | |
8707432a | 36 | {include file="CRM/Activity/Form/ActivityJs.tpl" tokenContext="activity"} |
6a488035 TO |
37 | {if !$action or ( $action eq 1 ) or ( $action eq 2 ) } |
38 | <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div> | |
39 | {/if} | |
40 | ||
41 | {if $action eq 8} {* Delete action. *} | |
42 | <table class="form-layout"> | |
43 | <tr> | |
44 | <td colspan="2"> | |
b25c334b | 45 | <div class="status">{ts}Are you sure you want to delete {/ts}{if $delName}'{$delName}'{/if}?</div> |
6a488035 TO |
46 | </td> |
47 | </tr> | |
48 | {elseif $action eq 1 or $action eq 2 or $action eq 4 or $context eq 'search' or $context eq 'smog'} | |
49 | ||
50 | <table class="{if $action eq 4}crm-info-panel{else}form-layout{/if}"> | |
51 | ||
52 | {if $action eq 4} | |
6a488035 TO |
53 | {if $activityTypeDescription } |
54 | <div class="help">{$activityTypeDescription}</div> | |
edc51caa | 55 | {/if} |
6a488035 TO |
56 | {else} |
57 | {if $context eq 'standalone' or $context eq 'search' or $context eq 'smog'} | |
58 | <tr class="crm-activity-form-block-activity_type_id"> | |
59 | <td class="label">{$form.activity_type_id.label}</td><td class="view-value">{$form.activity_type_id.html}</td> | |
60 | </tr> | |
61 | {/if} | |
62 | {/if} | |
63 | ||
64 | {if $surveyActivity} | |
65 | <tr class="crm-activity-form-block-survey"> | |
66 | <td class="label">{ts}Survey Title{/ts}</td><td class="view-value">{$surveyTitle}</td> | |
67 | </tr> | |
68 | {/if} | |
69 | ||
70 | <tr class="crm-activity-form-block-source_contact_id"> | |
71 | <td class="label">{$form.source_contact_id.label}</td> | |
72 | <td class="view-value"> | |
f7305cbc | 73 | {$form.source_contact_id.html} |
6a488035 TO |
74 | </td> |
75 | </tr> | |
76 | ||
77 | <tr class="crm-activity-form-block-target_contact_id"> | |
ab911378 PJ |
78 | <td class="label">{$form.target_contact_id.label}</td> |
79 | <td class="view-value"> | |
80 | {$form.target_contact_id.html} | |
ab911378 | 81 | </td> |
6a488035 | 82 | </tr> |
8ef12e64 | 83 | |
598e9b75 | 84 | {if $form.separation } |
a850c3fe SM |
85 | <tr class="crm-activity-form-block-separation crm-is-multi-activity-wrapper"> |
86 | <td class="label">{$form.separation.label}</td> | |
87 | <td>{$form.separation.html} {help id="separation"}</td> | |
88 | </tr> | |
89 | {/if} | |
90 | ||
6a488035 | 91 | <tr class="crm-activity-form-block-assignee_contact_id"> |
f71cfc02 CW |
92 | <td class="label"> |
93 | {$form.assignee_contact_id.label} | |
94 | {edit}{help id="assignee_contact_id" title=$form.assignee_contact_id.label}{/edit} | |
95 | </td> | |
8cc24f78 | 96 | <td> |
c27ebe4e CW |
97 | {$form.assignee_contact_id.html} |
98 | {if $action neq 4} | |
33913af6 CW |
99 | {if !$form.target_contact_id.frozen} |
100 | <a href="#" class="crm-hover-button" id="swap_target_assignee" title="{ts}Swap Target and Assignee Contacts{/ts}" style="position:relative; bottom: 1em;"> | |
aac8c264 | 101 | <i class="crm-i fa-random"></i> |
33913af6 CW |
102 | </a> |
103 | {/if} | |
6db7e202 | 104 | {if $activityAssigneeNotification} |
f71cfc02 | 105 | <br /> |
e680ea41 | 106 | <span id="notify_assignee_msg" class="description"><i class="crm-i fa-paper-plane"></i> {ts}A copy of this activity will be emailed to each Assignee.{/ts} {help id="sent_copy_email"}</span> |
6a488035 | 107 | {/if} |
f71cfc02 | 108 | {/if} |
6a488035 | 109 | </td> |
6a488035 TO |
110 | </tr> |
111 | ||
112 | {if $activityTypeFile} | |
113 | {include file="CRM/$crmDir/Form/Activity/$activityTypeFile.tpl"} | |
114 | {/if} | |
115 | ||
116 | <tr class="crm-activity-form-block-subject"> | |
117 | <td class="label">{$form.subject.label}</td><td class="view-value">{$form.subject.html|crmAddClass:huge}</td> | |
118 | </tr> | |
119 | ||
120 | {* CRM-7362 --add campaign to activities *} | |
121 | {include file="CRM/Campaign/Form/addCampaignToComponent.tpl" | |
122 | campaignTrClass="crm-activity-form-block-campaign_id"} | |
123 | ||
124 | {* build engagement level CRM-7775 *} | |
125 | {if $buildEngagementLevel} | |
126 | <tr class="crm-activity-form-block-engagement_level"> | |
127 | <td class="label">{$form.engagement_level.label}</td> | |
128 | <td class="view-value">{$form.engagement_level.html}</td> | |
129 | </tr> | |
130 | {/if} | |
131 | ||
132 | <tr class="crm-activity-form-block-location"> | |
133 | <td class="label">{$form.location.label}</td><td class="view-value">{$form.location.html|crmAddClass:huge}</td> | |
134 | </tr> | |
135 | <tr class="crm-activity-form-block-activity_date_time"> | |
136 | <td class="label">{$form.activity_date_time.label}</td> | |
137 | {if $action neq 4} | |
d104311a | 138 | <td class="view-value">{$form.activity_date_time.html}</td> |
6a488035 | 139 | {else} |
d32858b8 | 140 | <td class="view-value">{$form.activity_date_time.value|crmDate}</td> |
6a488035 TO |
141 | {/if} |
142 | </tr> | |
143 | <tr class="crm-activity-form-block-duration"> | |
144 | <td class="label">{$form.duration.label}</td> | |
145 | <td class="view-value"> | |
146 | {$form.duration.html} | |
56468778 | 147 | {if $action neq 4}<span class="description">{ts}minutes{/ts}{/if} |
6a488035 TO |
148 | </td> |
149 | </tr> | |
150 | <tr class="crm-activity-form-block-status_id"> | |
151 | <td class="label">{$form.status_id.label}</td><td class="view-value">{$form.status_id.html}</td> | |
152 | </tr> | |
153 | <tr class="crm-activity-form-block-details"> | |
154 | <td class="label">{$form.details.label}</td> | |
155 | {if $activityTypeName eq "Print PDF Letter"} | |
156 | <td class="view-value"> | |
13d9bc82 | 157 | {$form.details.html} |
6a488035 | 158 | </td> |
de8ce74e | 159 | {elseif $activityTypeName eq "Inbound Email"} |
6a488035 | 160 | <td class="view-value"> |
ef9fac72 | 161 | {$form.details.html|crmStripAlternatives|nl2br} |
6a488035 | 162 | </td> |
de8ce74e ML |
163 | {else} |
164 | <td class="view-value"> | |
165 | {$form.details.html|crmStripAlternatives} | |
166 | </td> | |
6a488035 TO |
167 | {/if} |
168 | </tr> | |
169 | <tr class="crm-activity-form-block-priority_id"> | |
170 | <td class="label">{$form.priority_id.label}</td><td class="view-value">{$form.priority_id.html}</td> | |
171 | </tr> | |
172 | {if $surveyActivity } | |
173 | <tr class="crm-activity-form-block-result"> | |
174 | <td class="label">{$form.result.label}</td><td class="view-value">{$form.result.html}</td> | |
175 | </tr> | |
176 | {/if} | |
177 | {if $form.tag.html} | |
178 | <tr class="crm-activity-form-block-tag"> | |
179 | <td class="label">{$form.tag.label}</td> | |
ab345ca5 CW |
180 | <td class="view-value"> |
181 | <div class="crm-select-container">{$form.tag.html}</div> | |
6a488035 TO |
182 | </td> |
183 | </tr> | |
184 | {/if} | |
185 | ||
c087eb82 CW |
186 | {if $tagsetInfo.activity} |
187 | <tr class="crm-activity-form-block-tag_set">{include file="CRM/common/Tagset.tpl" tagsetType='activity' tableLayout=true}</tr> | |
6a488035 TO |
188 | {/if} |
189 | ||
190 | {if $action neq 4 OR $viewCustomData} | |
191 | <tr class="crm-activity-form-block-custom_data"> | |
192 | <td colspan="2"> | |
193 | {if $action eq 4} | |
194 | {include file="CRM/Custom/Page/CustomDataView.tpl"} | |
195 | {else} | |
196 | <div id="customData"></div> | |
197 | {/if} | |
198 | </td> | |
199 | </tr> | |
200 | {/if} | |
201 | ||
202 | {if $action eq 4 AND $currentAttachmentInfo} | |
203 | {include file="CRM/Form/attachment.tpl"}{* For view action the include provides the row and cells. *} | |
204 | {elseif $action eq 1 OR $action eq 2} | |
205 | <tr class="crm-activity-form-block-attachment"> | |
206 | <td colspan="2"> | |
207 | {include file="CRM/Form/attachment.tpl"} | |
208 | </td> | |
209 | </tr> | |
210 | {/if} | |
59d63f8b | 211 | |
b334d9ad | 212 | {if $action eq 2 OR $action eq 1} |
78fe87e6 | 213 | <tr class="crm-activity-form-block-recurring_activity"> |
214 | <td colspan="2"> | |
d2a4c29b | 215 | {include file="CRM/Core/Form/RecurringEntity.tpl" recurringFormIsEmbedded=true} |
78fe87e6 | 216 | </td> |
217 | </tr> | |
218 | {/if} | |
59d63f8b | 219 | |
6a488035 TO |
220 | {if $action neq 4} {* Don't include "Schedule Follow-up" section in View mode. *} |
221 | <tr class="crm-activity-form-block-schedule_followup"> | |
222 | <td colspan="2"> | |
cfcf9132 | 223 | {include file="CRM/Activity/Form/FollowUp.tpl" type=""} |
6a488035 TO |
224 | {literal} |
225 | <script type="text/javascript"> | |
3cc60a06 | 226 | CRM.$(function($) { |
63c886b1 CW |
227 | var $form = $('form.{/literal}{$form.formClass}{literal}'); |
228 | $('.crm-accordion-body', $form).each( function() { | |
6a488035 | 229 | //open tab if form rule throws error |
ae8f569f CW |
230 | if ( $(this).children( ).find('span.crm-error').text( ).length > 0 ) { |
231 | $(this).parent('.collapsed').crmAccordionToggle(); | |
6a488035 TO |
232 | } |
233 | }); | |
63c886b1 CW |
234 | function toggleMultiActivityCheckbox() { |
235 | $('.crm-is-multi-activity-wrapper').toggle(!!($(this).val() && $(this).val().indexOf(',') > 0)); | |
236 | } | |
237 | $('[name=target_contact_id]', $form).each(toggleMultiActivityCheckbox).change(toggleMultiActivityCheckbox); | |
238 | $('#swap_target_assignee').click(function(e) { | |
239 | e.preventDefault(); | |
240 | var assignees = $('#assignee_contact_id', $form).select2("data"); | |
241 | var targets = $('#target_contact_id', $form).select2("data"); | |
242 | $('#assignee_contact_id', $form).select2("data", targets); | |
243 | $('#target_contact_id', $form).select2("data", assignees).change(); | |
9285bb0f AH |
244 | }); |
245 | }); | |
6a488035 TO |
246 | </script> |
247 | {/literal} | |
248 | </td> | |
249 | </tr> | |
250 | {/if} | |
251 | {/if} {* End Delete vs. Add / Edit action *} | |
252 | </table> | |
253 | <div class="crm-submit-buttons"> | |
ee90a98c | 254 | {if $action eq 4 && ($activityTName neq 'Inbound Email' || $allow_edit_inbound_emails == 1)} |
6a488035 TO |
255 | {if !$context } |
256 | {assign var="context" value='activity'} | |
257 | {/if} | |
258 | {if $permission EQ 'edit'} | |
259 | {assign var='urlParams' value="reset=1&atype=$atype&action=update&reset=1&id=$entityID&cid=$contactId&context=$context"} | |
260 | {if ($context eq 'fulltext' || $context eq 'search') && $searchKey} | |
261 | {assign var='urlParams' value="reset=1&atype=$atype&action=update&reset=1&id=$entityID&cid=$contactId&context=$context&key=$searchKey"} | |
262 | {/if} | |
aac8c264 | 263 | <a href="{crmURL p='civicrm/activity/add' q=$urlParams}" class="edit button" title="{ts}Edit{/ts}"><span><i class="crm-i fa-pencil"></i> {ts}Edit{/ts}</span></a> |
6a488035 TO |
264 | {/if} |
265 | ||
266 | {if call_user_func(array('CRM_Core_Permission','check'), 'delete activities')} | |
267 | {assign var='urlParams' value="reset=1&atype=$atype&action=delete&reset=1&id=$entityID&cid=$contactId&context=$context"} | |
268 | {if ($context eq 'fulltext' || $context eq 'search') && $searchKey} | |
269 | {assign var='urlParams' value="reset=1&atype=$atype&action=delete&reset=1&id=$entityID&cid=$contactId&context=$context&key=$searchKey"} | |
270 | {/if} | |
aac8c264 | 271 | <a href="{crmURL p='civicrm/contact/view/activity' q=$urlParams}" class="delete button" title="{ts}Delete{/ts}"><span><i class="crm-i fa-trash"></i> {ts}Delete{/ts}</span></a> |
6a488035 TO |
272 | {/if} |
273 | {/if} | |
5ff596c0 | 274 | {if $action eq 4 and $context != 'case' and call_user_func(array('CRM_Case_BAO_Case','checkPermission'), $activityId, 'File On Case', $atype)} |
aac8c264 | 275 | <a href="#" onclick="fileOnCase('file', {$activityId}, null, this); return false;" class="cancel button" title="{ts}File On Case{/ts}"><span><i class="crm-i fa-clipboard"></i> {ts}File on Case{/ts}</span></a> |
5ff596c0 | 276 | {include file="CRM/Case/Form/ActivityToCase.tpl"} |
5b7581f1 | 277 | {/if} |
6a488035 TO |
278 | {include file="CRM/common/formButtons.tpl" location="bottom"} |
279 | </div> | |
280 | ||
6a488035 TO |
281 | |
282 | {if $action eq 1 or $action eq 2 or $context eq 'search' or $context eq 'smog'} | |
e680ea41 JP |
283 | {*include custom data js file*} |
284 | {include file="CRM/common/customData.tpl"} | |
6a488035 TO |
285 | {literal} |
286 | <script type="text/javascript"> | |
3cc60a06 | 287 | CRM.$(function($) { |
b8ad9c84 | 288 | var doNotNotifyAssigneeFor = {/literal}{$doNotNotifyAssigneeFor|@json_encode}{literal}; |
e680ea41 JP |
289 | $('#activity_type_id').change(function() { |
290 | if ($.inArray($(this).val(), doNotNotifyAssigneeFor) != -1) { | |
291 | $('#notify_assignee_msg').hide(); | |
292 | } | |
293 | else { | |
294 | $('#notify_assignee_msg').show(); | |
295 | } | |
296 | }); | |
297 | ||
298 | {/literal} | |
299 | {if $customDataSubType} | |
300 | CRM.buildCustomData( '{$customDataType}', {$customDataSubType} ); | |
301 | {else} | |
302 | CRM.buildCustomData( '{$customDataType}' ); | |
303 | {/if} | |
304 | {literal} | |
6a488035 TO |
305 | }); |
306 | </script> | |
307 | {/literal} | |
308 | {/if} | |
6a488035 | 309 | </div>{* end of form block*} |
39082712 | 310 | |
3d3d45c4 | 311 | {include file="CRM/Event/Form/ManageEvent/ConfirmRepeatMode.tpl" entityID=$activityId entityTable="civicrm_activity"} |