Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
819d0d41 | 3 | | CiviCRM version 4.5 | |
6a488035 | 4 | +--------------------------------------------------------------------+ |
819d0d41 | 5 | | Copyright CiviCRM LLC (c) 2004-2014 | |
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} | |
85 | <br/> | |
86 | {$form.is_multi_activity.html} {$form.is_multi_activity.label} {help id="id-is_multi_activity"} | |
87 | {/if} | |
88 | </td> | |
6a488035 | 89 | </tr> |
8ef12e64 | 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;"> | |
101 | <span class="icon ui-icon-shuffle"></span> | |
102 | </a> | |
103 | {/if} | |
6db7e202 | 104 | {if $activityAssigneeNotification} |
f71cfc02 CW |
105 | <br /> |
106 | <span class="description"><span class="icon email-icon"></span>{ts}A copy of this activity will be emailed to each Assignee.{/ts}</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} | |
138 | <td class="view-value">{include file="CRM/common/jcalendar.tpl" elementName=activity_date_time}</td> | |
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"> | |
157 | {* If using plain textarea, assign class=huge to make input large enough. *} | |
158 | {if $defaultWysiwygEditor eq 0}{$form.details.html|crmAddClass:huge}{else}{$form.details.html}{/if} | |
159 | </td> | |
160 | {else} | |
161 | <td class="view-value"> | |
162 | {* If using plain textarea, assign class=huge to make input large enough. *} | |
163 | {if $defaultWysiwygEditor eq 0}{$form.details.html|crmStripAlternatives|crmAddClass:huge}{else}{$form.details.html|crmStripAlternatives}{/if} | |
164 | </td> | |
165 | {/if} | |
166 | </tr> | |
167 | <tr class="crm-activity-form-block-priority_id"> | |
168 | <td class="label">{$form.priority_id.label}</td><td class="view-value">{$form.priority_id.html}</td> | |
169 | </tr> | |
170 | {if $surveyActivity } | |
171 | <tr class="crm-activity-form-block-result"> | |
172 | <td class="label">{$form.result.label}</td><td class="view-value">{$form.result.html}</td> | |
173 | </tr> | |
174 | {/if} | |
175 | {if $form.tag.html} | |
176 | <tr class="crm-activity-form-block-tag"> | |
177 | <td class="label">{$form.tag.label}</td> | |
ab345ca5 CW |
178 | <td class="view-value"> |
179 | <div class="crm-select-container">{$form.tag.html}</div> | |
6a488035 TO |
180 | </td> |
181 | </tr> | |
182 | {/if} | |
183 | ||
c087eb82 CW |
184 | {if $tagsetInfo.activity} |
185 | <tr class="crm-activity-form-block-tag_set">{include file="CRM/common/Tagset.tpl" tagsetType='activity' tableLayout=true}</tr> | |
6a488035 TO |
186 | {/if} |
187 | ||
188 | {if $action neq 4 OR $viewCustomData} | |
189 | <tr class="crm-activity-form-block-custom_data"> | |
190 | <td colspan="2"> | |
191 | {if $action eq 4} | |
192 | {include file="CRM/Custom/Page/CustomDataView.tpl"} | |
193 | {else} | |
194 | <div id="customData"></div> | |
195 | {/if} | |
196 | </td> | |
197 | </tr> | |
198 | {/if} | |
199 | ||
200 | {if $action eq 4 AND $currentAttachmentInfo} | |
201 | {include file="CRM/Form/attachment.tpl"}{* For view action the include provides the row and cells. *} | |
202 | {elseif $action eq 1 OR $action eq 2} | |
203 | <tr class="crm-activity-form-block-attachment"> | |
204 | <td colspan="2"> | |
205 | {include file="CRM/Form/attachment.tpl"} | |
206 | </td> | |
207 | </tr> | |
208 | {/if} | |
59d63f8b | 209 | |
b334d9ad | 210 | {if $action eq 2 OR $action eq 1} |
78fe87e6 | 211 | <tr class="crm-activity-form-block-recurring_activity"> |
212 | <td colspan="2"> | |
213 | {include file="CRM/Core/Form/RecurringEntity.tpl"} | |
214 | {literal} | |
215 | <script type="text/javascript"> | |
216 | CRM.$(function($) { | |
217 | if ($('#activity_date_time').val() !== "" && $('#activity_date_time_time').val() !== "") { | |
b334d9ad | 218 | $('#repetition_start_date, #repetition_start_date_display').val($('#activity_date_time').val()); |
78fe87e6 | 219 | $('#repetition_start_date_time').val($('#activity_date_time_time').val()); |
220 | } | |
5cdeded4 | 221 | |
222 | $('#activity_date_time_display').change(function() { | |
be7060fb | 223 | $('#repetition_start_date, #repetition_start_date_display').val($('#activity_date_time').val()); |
5cdeded4 | 224 | }); |
225 | ||
226 | $('#activity_date_time_time').change(function() { | |
78fe87e6 | 227 | $('#repetition_start_date_time').val($('#activity_date_time_time').val()); |
228 | }); | |
5cdeded4 | 229 | |
b334d9ad | 230 | if ($('#start_action_offset').val() == "" && $('#repeat_absolute_date_display').val() == "") { |
231 | $('#recurring-entity-block').addClass('collapsed'); | |
232 | } | |
78fe87e6 | 233 | }); |
234 | </script> | |
235 | {/literal} | |
c2c53778 | 236 | {if $action eq 1} |
237 | {literal} | |
238 | <script type="text/javascript"> | |
239 | CRM.$(function($) { | |
240 | $('#recurring-entity-block div.crm-submit-buttons').css('display', 'none'); | |
241 | }); | |
242 | </script> | |
243 | {/literal} | |
244 | {/if} | |
78fe87e6 | 245 | </td> |
246 | </tr> | |
247 | {/if} | |
59d63f8b | 248 | |
6a488035 TO |
249 | {if $action neq 4} {* Don't include "Schedule Follow-up" section in View mode. *} |
250 | <tr class="crm-activity-form-block-schedule_followup"> | |
251 | <td colspan="2"> | |
252 | <div class="crm-accordion-wrapper collapsed"> | |
253 | <div class="crm-accordion-header"> | |
254 | {ts}Schedule Follow-up{/ts} | |
255 | </div><!-- /.crm-accordion-header --> | |
256 | <div class="crm-accordion-body"> | |
257 | <table class="form-layout-compressed"> | |
258 | <tr><td class="label">{ts}Schedule Follow-up Activity{/ts}</td> | |
259 | <td>{$form.followup_activity_type_id.html} {ts}on{/ts} | |
260 | {include file="CRM/common/jcalendar.tpl" elementName=followup_date} | |
261 | </td> | |
262 | </tr> | |
263 | <tr> | |
264 | <td class="label">{$form.followup_activity_subject.label}</td> | |
265 | <td>{$form.followup_activity_subject.html|crmAddClass:huge}</td> | |
266 | </tr> | |
90b05581 | 267 | <tr> |
f71cfc02 CW |
268 | <td class="label"> |
269 | {$form.followup_assignee_contact_id.label} | |
270 | {edit} | |
271 | {/edit} | |
272 | </td> | |
273 | <td> | |
274 | {$form.followup_assignee_contact_id.html} | |
90b05581 DG |
275 | </td> |
276 | </tr> | |
6a488035 TO |
277 | </table> |
278 | </div><!-- /.crm-accordion-body --> | |
279 | </div><!-- /.crm-accordion-wrapper --> | |
280 | {literal} | |
281 | <script type="text/javascript"> | |
3cc60a06 | 282 | CRM.$(function($) { |
ae8f569f | 283 | $('.crm-accordion-body').each( function() { |
6a488035 | 284 | //open tab if form rule throws error |
ae8f569f CW |
285 | if ( $(this).children( ).find('span.crm-error').text( ).length > 0 ) { |
286 | $(this).parent('.collapsed').crmAccordionToggle(); | |
6a488035 TO |
287 | } |
288 | }); | |
c27ebe4e CW |
289 | $('#swap_target_assignee').click(function() { |
290 | var assignees = $('#assignee_contact_id').select2("data"); | |
291 | var targets = $('#target_contact_id').select2("data"); | |
292 | $('#assignee_contact_id').select2("data", targets); | |
293 | $('#target_contact_id').select2("data", assignees); | |
294 | return false; | |
9285bb0f AH |
295 | }); |
296 | }); | |
6a488035 TO |
297 | </script> |
298 | {/literal} | |
299 | </td> | |
300 | </tr> | |
301 | {/if} | |
302 | {/if} {* End Delete vs. Add / Edit action *} | |
303 | </table> | |
304 | <div class="crm-submit-buttons"> | |
305 | {if $action eq 4 && $activityTName neq 'Inbound Email'} | |
306 | {if !$context } | |
307 | {assign var="context" value='activity'} | |
308 | {/if} | |
309 | {if $permission EQ 'edit'} | |
310 | {assign var='urlParams' value="reset=1&atype=$atype&action=update&reset=1&id=$entityID&cid=$contactId&context=$context"} | |
311 | {if ($context eq 'fulltext' || $context eq 'search') && $searchKey} | |
312 | {assign var='urlParams' value="reset=1&atype=$atype&action=update&reset=1&id=$entityID&cid=$contactId&context=$context&key=$searchKey"} | |
313 | {/if} | |
314 | <a href="{crmURL p='civicrm/activity/add' q=$urlParams}" class="edit button" title="{ts}Edit{/ts}"><span><div class="icon edit-icon"></div>{ts}Edit{/ts}</span></a> | |
315 | {/if} | |
316 | ||
317 | {if call_user_func(array('CRM_Core_Permission','check'), 'delete activities')} | |
318 | {assign var='urlParams' value="reset=1&atype=$atype&action=delete&reset=1&id=$entityID&cid=$contactId&context=$context"} | |
319 | {if ($context eq 'fulltext' || $context eq 'search') && $searchKey} | |
320 | {assign var='urlParams' value="reset=1&atype=$atype&action=delete&reset=1&id=$entityID&cid=$contactId&context=$context&key=$searchKey"} | |
321 | {/if} | |
322 | <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> | |
323 | {/if} | |
324 | {/if} | |
5b7581f1 | 325 | {if $action eq 4 and call_user_func(array('CRM_Case_BAO_Case','checkPermission'), $activityId, 'File On Case', $atype)} |
ac8588ff | 326 | <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 | 327 | {/if} |
6a488035 TO |
328 | {include file="CRM/common/formButtons.tpl" location="bottom"} |
329 | </div> | |
330 | ||
331 | {include file="CRM/Case/Form/ActivityToCase.tpl"} | |
332 | ||
333 | {if $action eq 1 or $action eq 2 or $context eq 'search' or $context eq 'smog'} | |
334 | {*include custom data js file*} | |
335 | {include file="CRM/common/customData.tpl"} | |
336 | {literal} | |
337 | <script type="text/javascript"> | |
3cc60a06 | 338 | CRM.$(function($) { |
6a488035 TO |
339 | {/literal} |
340 | {if $customDataSubType} | |
341 | CRM.buildCustomData( '{$customDataType}', {$customDataSubType} ); | |
342 | {else} | |
343 | CRM.buildCustomData( '{$customDataType}' ); | |
344 | {/if} | |
345 | {literal} | |
346 | }); | |
347 | </script> | |
348 | {/literal} | |
349 | {/if} | |
6a488035 TO |
350 | </div>{* end of form block*} |
351 | {/if} {* end of snippet if*} | |
3d3d45c4 | 352 | {include file="CRM/Event/Form/ManageEvent/ConfirmRepeatMode.tpl" entityID=$activityId entityTable="civicrm_activity"} |