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