Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
232624b1 | 3 | | CiviCRM version 4.4 | |
6a488035 TO |
4 | +--------------------------------------------------------------------+ |
5 | | Copyright CiviCRM LLC (c) 2004-2013 | | |
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} | |
33 | {if $context NEQ 'standalone'} | |
da520b85 | 34 | <h3>{if $action eq 1 or $action eq 1024}{ts 1=$activityTypeName}New activity: %1{/ts}{elseif $action eq 8}{ts 1=$activityTypeName}Delete %1{/ts}{else}{ts 1=$activityTypeName}Edit %1{/ts}{/if}</h3> |
6a488035 TO |
35 | {/if} |
36 | {if $activityTypeDescription } | |
37 | <div class="help">{$activityTypeDescription}</div> | |
38 | {/if} | |
39 | <div class="crm-block crm-form-block crm-activity-form-block"> | |
40 | {/if} | |
41 | {* added onload javascript for source contact*} | |
8707432a | 42 | {include file="CRM/Activity/Form/ActivityJs.tpl" tokenContext="activity"} |
6a488035 TO |
43 | {if !$action or ( $action eq 1 ) or ( $action eq 2 ) } |
44 | <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div> | |
45 | {/if} | |
46 | ||
47 | {if $action eq 8} {* Delete action. *} | |
48 | <table class="form-layout"> | |
49 | <tr> | |
50 | <td colspan="2"> | |
51 | <div class="status">{ts 1=$delName}Are you sure you want to delete '%1'?{/ts}</div> | |
52 | </td> | |
53 | </tr> | |
54 | {elseif $action eq 1 or $action eq 2 or $action eq 4 or $context eq 'search' or $context eq 'smog'} | |
55 | ||
56 | <table class="{if $action eq 4}crm-info-panel{else}form-layout{/if}"> | |
57 | ||
58 | {if $action eq 4} | |
59 | <h3>{$activityTypeName}</h3> | |
60 | {if $activityTypeDescription } | |
61 | <div class="help">{$activityTypeDescription}</div> | |
edc51caa | 62 | {/if} |
6a488035 TO |
63 | {else} |
64 | {if $context eq 'standalone' or $context eq 'search' or $context eq 'smog'} | |
65 | <tr class="crm-activity-form-block-activity_type_id"> | |
66 | <td class="label">{$form.activity_type_id.label}</td><td class="view-value">{$form.activity_type_id.html}</td> | |
67 | </tr> | |
68 | {/if} | |
69 | {/if} | |
70 | ||
71 | {if $surveyActivity} | |
72 | <tr class="crm-activity-form-block-survey"> | |
73 | <td class="label">{ts}Survey Title{/ts}</td><td class="view-value">{$surveyTitle}</td> | |
74 | </tr> | |
75 | {/if} | |
76 | ||
77 | <tr class="crm-activity-form-block-source_contact_id"> | |
78 | <td class="label">{$form.source_contact_id.label}</td> | |
79 | <td class="view-value"> | |
80 | {if $admin and $action neq 4}{$form.source_contact_id.html} {else} {$source_contact_value} {/if} | |
81 | </td> | |
82 | </tr> | |
83 | ||
84 | <tr class="crm-activity-form-block-target_contact_id"> | |
85 | {if $single eq false} | |
86 | <td class="label">{ts}With Contact(s){/ts}</td> | |
ef89f226 KJ |
87 | <td class="view-value" style="white-space: normal"> |
88 | {$with|escape} | |
89 | <br/> | |
0d4db96c | 90 | {$form.is_multi_activity.html} {$form.is_multi_activity.label} {help id="id-is_multi_activity"} |
ef89f226 | 91 | </td> |
6a488035 TO |
92 | {elseif $action neq 4} |
93 | <td class="label">{ts}With Contact{/ts}</td> | |
94 | <td class="view-value"> | |
50147a78 | 95 | {include file="CRM/Contact/Form/NewContact.tpl" noLabel=true skipBreak=true multiClient=true parent="activity" showNewSelect=true} |
52c7b3a2 KJ |
96 | {if $action eq 1} |
97 | <br/> | |
3efc2908 | 98 | {$form.is_multi_activity.html} {$form.is_multi_activity.label} {help id="id-is_multi_activity"} |
52c7b3a2 | 99 | {/if} |
6a488035 TO |
100 | </td> |
101 | {else} | |
102 | <td class="label">{ts}With Contact{/ts}</td> | |
103 | <td class="view-value" style="white-space: normal"> | |
104 | {foreach from=$target_contact key=id item=name} | |
105 | <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$id"}">{$name}</a>; | |
106 | {/foreach} | |
107 | </td> | |
108 | {/if} | |
109 | </tr> | |
8ef12e64 | 110 | |
6a488035 TO |
111 | <tr class="crm-activity-form-block-assignee_contact_id"> |
112 | {if $action eq 4} | |
113 | <td class="label">{ts}Assigned To{/ts}</td><td class="view-value"> | |
114 | {foreach from=$assignee_contact key=id item=name} | |
115 | <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$id"}">{$name}</a>; | |
116 | {/foreach} | |
117 | </td> | |
118 | {else} | |
119 | <td class="label">{ts}Assigned To{/ts}</td> | |
8cc24f78 CW |
120 | <td> |
121 | <a href="#" class="button" id="swap_target_assignee" title="{ts}Swap Target and Assignee Contacts{/ts}" style="float:right;"> | |
122 | <span> | |
123 | <div class="icon swap-icon"></div> | |
124 | </span> | |
125 | </a> | |
126 | {$form.assignee_contact_id.html} | |
6a488035 TO |
127 | {edit} |
128 | <span class="description">{ts}You can optionally assign this activity to someone. Assigned activities will appear in their Activities listing at CiviCRM Home.{/ts} | |
6db7e202 | 129 | {if $activityAssigneeNotification} |
6a488035 TO |
130 | <br />{ts}A copy of this activity will be emailed to each Assignee.{/ts} |
131 | {/if} | |
132 | </span> | |
133 | {/edit} | |
134 | </td> | |
135 | {/if} | |
136 | </tr> | |
137 | ||
138 | {if $activityTypeFile} | |
139 | {include file="CRM/$crmDir/Form/Activity/$activityTypeFile.tpl"} | |
140 | {/if} | |
141 | ||
142 | <tr class="crm-activity-form-block-subject"> | |
143 | <td class="label">{$form.subject.label}</td><td class="view-value">{$form.subject.html|crmAddClass:huge}</td> | |
144 | </tr> | |
145 | ||
146 | {* CRM-7362 --add campaign to activities *} | |
147 | {include file="CRM/Campaign/Form/addCampaignToComponent.tpl" | |
148 | campaignTrClass="crm-activity-form-block-campaign_id"} | |
149 | ||
150 | {* build engagement level CRM-7775 *} | |
151 | {if $buildEngagementLevel} | |
152 | <tr class="crm-activity-form-block-engagement_level"> | |
153 | <td class="label">{$form.engagement_level.label}</td> | |
154 | <td class="view-value">{$form.engagement_level.html}</td> | |
155 | </tr> | |
156 | {/if} | |
157 | ||
158 | <tr class="crm-activity-form-block-location"> | |
159 | <td class="label">{$form.location.label}</td><td class="view-value">{$form.location.html|crmAddClass:huge}</td> | |
160 | </tr> | |
161 | <tr class="crm-activity-form-block-activity_date_time"> | |
162 | <td class="label">{$form.activity_date_time.label}</td> | |
163 | {if $action neq 4} | |
164 | <td class="view-value">{include file="CRM/common/jcalendar.tpl" elementName=activity_date_time}</td> | |
165 | {else} | |
166 | <td class="view-value">{$form.activity_date_time.html|crmDate}</td> | |
167 | {/if} | |
168 | </tr> | |
169 | <tr class="crm-activity-form-block-duration"> | |
170 | <td class="label">{$form.duration.label}</td> | |
171 | <td class="view-value"> | |
172 | {$form.duration.html} | |
173 | {if $action neq 4}<span class="description">{ts}Total time spent on this activity (in minutes).{/ts}{/if} | |
174 | </td> | |
175 | </tr> | |
176 | <tr class="crm-activity-form-block-status_id"> | |
177 | <td class="label">{$form.status_id.label}</td><td class="view-value">{$form.status_id.html}</td> | |
178 | </tr> | |
179 | <tr class="crm-activity-form-block-details"> | |
180 | <td class="label">{$form.details.label}</td> | |
181 | {if $activityTypeName eq "Print PDF Letter"} | |
182 | <td class="view-value"> | |
183 | {* If using plain textarea, assign class=huge to make input large enough. *} | |
184 | {if $defaultWysiwygEditor eq 0}{$form.details.html|crmAddClass:huge}{else}{$form.details.html}{/if} | |
185 | </td> | |
186 | {else} | |
187 | <td class="view-value"> | |
188 | {* If using plain textarea, assign class=huge to make input large enough. *} | |
189 | {if $defaultWysiwygEditor eq 0}{$form.details.html|crmStripAlternatives|crmAddClass:huge}{else}{$form.details.html|crmStripAlternatives}{/if} | |
190 | </td> | |
191 | {/if} | |
192 | </tr> | |
193 | <tr class="crm-activity-form-block-priority_id"> | |
194 | <td class="label">{$form.priority_id.label}</td><td class="view-value">{$form.priority_id.html}</td> | |
195 | </tr> | |
196 | {if $surveyActivity } | |
197 | <tr class="crm-activity-form-block-result"> | |
198 | <td class="label">{$form.result.label}</td><td class="view-value">{$form.result.html}</td> | |
199 | </tr> | |
200 | {/if} | |
201 | {if $form.tag.html} | |
202 | <tr class="crm-activity-form-block-tag"> | |
203 | <td class="label">{$form.tag.label}</td> | |
204 | <td class="view-value"><div class="crm-select-container">{$form.tag.html}</div> | |
205 | {literal} | |
206 | <script type="text/javascript"> | |
207 | cj(".crm-activity-form-block-tag select[multiple]").crmasmSelect({ | |
208 | addItemTarget: 'bottom', | |
209 | animate: true, | |
210 | highlight: true, | |
211 | sortable: true, | |
212 | respectParents: true | |
213 | }); | |
214 | </script> | |
215 | {/literal} | |
216 | </td> | |
217 | </tr> | |
218 | {/if} | |
219 | ||
220 | {if $tagsetInfo_activity} | |
221 | <tr class="crm-activity-form-block-tag_set"><td colspan="2">{include file="CRM/common/Tag.tpl" tagsetType='activity'}</td></tr> | |
222 | {/if} | |
223 | ||
224 | {if $action neq 4 OR $viewCustomData} | |
225 | <tr class="crm-activity-form-block-custom_data"> | |
226 | <td colspan="2"> | |
227 | {if $action eq 4} | |
228 | {include file="CRM/Custom/Page/CustomDataView.tpl"} | |
229 | {else} | |
230 | <div id="customData"></div> | |
231 | {/if} | |
232 | </td> | |
233 | </tr> | |
234 | {/if} | |
235 | ||
236 | {if $action eq 4 AND $currentAttachmentInfo} | |
237 | {include file="CRM/Form/attachment.tpl"}{* For view action the include provides the row and cells. *} | |
238 | {elseif $action eq 1 OR $action eq 2} | |
239 | <tr class="crm-activity-form-block-attachment"> | |
240 | <td colspan="2"> | |
241 | {include file="CRM/Form/attachment.tpl"} | |
242 | </td> | |
243 | </tr> | |
244 | {/if} | |
245 | ||
246 | {if $action neq 4} {* Don't include "Schedule Follow-up" section in View mode. *} | |
247 | <tr class="crm-activity-form-block-schedule_followup"> | |
248 | <td colspan="2"> | |
249 | <div class="crm-accordion-wrapper collapsed"> | |
250 | <div class="crm-accordion-header"> | |
251 | {ts}Schedule Follow-up{/ts} | |
252 | </div><!-- /.crm-accordion-header --> | |
253 | <div class="crm-accordion-body"> | |
254 | <table class="form-layout-compressed"> | |
255 | <tr><td class="label">{ts}Schedule Follow-up Activity{/ts}</td> | |
256 | <td>{$form.followup_activity_type_id.html} {ts}on{/ts} | |
257 | {include file="CRM/common/jcalendar.tpl" elementName=followup_date} | |
258 | </td> | |
259 | </tr> | |
260 | <tr> | |
261 | <td class="label">{$form.followup_activity_subject.label}</td> | |
262 | <td>{$form.followup_activity_subject.html|crmAddClass:huge}</td> | |
263 | </tr> | |
264 | </table> | |
265 | </div><!-- /.crm-accordion-body --> | |
266 | </div><!-- /.crm-accordion-wrapper --> | |
267 | {literal} | |
268 | <script type="text/javascript"> | |
269 | cj(function() { | |
270 | cj().crmAccordions(); | |
271 | cj('.crm-accordion-body').each( function() { | |
272 | //open tab if form rule throws error | |
273 | if ( cj(this).children( ).find('span.crm-error').text( ).length > 0 ) { | |
274 | cj(this).parent('.collapsed').crmAccordionToggle(); | |
275 | } | |
276 | }); | |
277 | }); | |
9285bb0f AH |
278 | cj('#swap_target_assignee').click( function() { |
279 | var assignees = cj('input#assignee_contact_id').tokenInput("get"); | |
280 | var targets = cj('input#contact_1').tokenInput("get"); | |
281 | cj('#assignee_contact_id').tokenInput("clear"); | |
282 | cj('#contact_1').tokenInput("clear"); | |
283 | cj(assignees).each( function() { | |
284 | cj('#contact_1').tokenInput("add", this); | |
285 | }); | |
286 | cj(targets).each( function() { | |
287 | cj('#assignee_contact_id').tokenInput("add", this); | |
288 | }); | |
43f7a76f | 289 | return false; |
9285bb0f | 290 | }); |
6a488035 TO |
291 | </script> |
292 | {/literal} | |
293 | </td> | |
294 | </tr> | |
295 | {/if} | |
296 | {/if} {* End Delete vs. Add / Edit action *} | |
297 | </table> | |
298 | <div class="crm-submit-buttons"> | |
299 | {if $action eq 4 && $activityTName neq 'Inbound Email'} | |
300 | {if !$context } | |
301 | {assign var="context" value='activity'} | |
302 | {/if} | |
303 | {if $permission EQ 'edit'} | |
304 | {assign var='urlParams' value="reset=1&atype=$atype&action=update&reset=1&id=$entityID&cid=$contactId&context=$context"} | |
305 | {if ($context eq 'fulltext' || $context eq 'search') && $searchKey} | |
306 | {assign var='urlParams' value="reset=1&atype=$atype&action=update&reset=1&id=$entityID&cid=$contactId&context=$context&key=$searchKey"} | |
307 | {/if} | |
308 | <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> | |
309 | {/if} | |
310 | ||
311 | {if call_user_func(array('CRM_Core_Permission','check'), 'delete activities')} | |
312 | {assign var='urlParams' value="reset=1&atype=$atype&action=delete&reset=1&id=$entityID&cid=$contactId&context=$context"} | |
313 | {if ($context eq 'fulltext' || $context eq 'search') && $searchKey} | |
314 | {assign var='urlParams' value="reset=1&atype=$atype&action=delete&reset=1&id=$entityID&cid=$contactId&context=$context&key=$searchKey"} | |
315 | {/if} | |
316 | <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> | |
317 | {/if} | |
318 | {/if} | |
319 | {include file="CRM/common/formButtons.tpl" location="bottom"} | |
320 | </div> | |
321 | ||
322 | {include file="CRM/Case/Form/ActivityToCase.tpl"} | |
323 | ||
324 | {if $action eq 1 or $action eq 2 or $context eq 'search' or $context eq 'smog'} | |
325 | {*include custom data js file*} | |
326 | {include file="CRM/common/customData.tpl"} | |
327 | {literal} | |
328 | <script type="text/javascript"> | |
329 | cj(function() { | |
330 | {/literal} | |
331 | {if $customDataSubType} | |
332 | CRM.buildCustomData( '{$customDataType}', {$customDataSubType} ); | |
333 | {else} | |
334 | CRM.buildCustomData( '{$customDataType}' ); | |
335 | {/if} | |
336 | {literal} | |
337 | }); | |
338 | </script> | |
339 | {/literal} | |
340 | {/if} | |
341 | {if ! $form.case_select} | |
342 | {include file="CRM/common/formNavigate.tpl"} | |
343 | {/if} | |
344 | </div>{* end of form block*} | |
345 | {/if} {* end of snippet if*} |