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 | ||
27 | {* this template is used for adding/editing activities for a case. *} | |
28 | {if $cdType } | |
29 | {include file="CRM/Custom/Form/CustomData.tpl"} | |
30 | {else} | |
6a488035 TO |
31 | <div class="crm-block crm-form-block crm-case-activity-form-block"> |
32 | ||
33 | {if $action neq 8 and $action neq 32768 } | |
34 | {* Include form buttons on top for new and edit modes. *} | |
35 | <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div> | |
36 | ||
37 | {* added onload javascript for source contact*} | |
8707432a | 38 | {include file="CRM/Activity/Form/ActivityJs.tpl" tokenContext="case_activity"} |
6a488035 TO |
39 | |
40 | {/if} | |
41 | ||
42 | {if $action eq 8 or $action eq 32768 } | |
43 | <div class="messages status no-popup"> | |
44 | <div class="icon inform-icon"></div> | |
45 | {if $action eq 8} | |
46 | {ts 1=$activityTypeName}Click Delete to move this "%1" activity to the Trash.{/ts} | |
47 | {else} | |
48 | {ts 1=$activityTypeName}Click Restore to retrieve this "%1" activity from the Trash.{/ts} | |
49 | {/if} | |
50 | </div><br /> | |
51 | {else} | |
52 | <table class="form-layout"> | |
53 | {if $activityTypeDescription } | |
54 | <tr> | |
55 | <div id="help">{$activityTypeDescription}</div> | |
56 | </tr> | |
57 | {/if} | |
1156155a P |
58 | {* Block for change status, case type and start date. *} |
59 | {if $activityTypeFile EQ 'ChangeCaseStatus' | |
60 | || $activityTypeFile EQ 'ChangeCaseType' | |
251924af | 61 | || $activityTypeFile EQ 'LinkCases' |
1156155a | 62 | || $activityTypeFile EQ 'ChangeCaseStartDate'} |
4d91aee1 P |
63 | {include file="CRM/Case/Form/Activity/$activityTypeFile.tpl"} |
64 | <tr class="crm-case-activity-form-block-details"> | |
ae41aacf | 65 | <td class="label">{ts}Notes{/ts}</td> |
6a488035 | 66 | <td class="view-value"> |
4d91aee1 P |
67 | {* If using plain textarea, assign class=huge to make input large enough. *} |
68 | {if $defaultWysiwygEditor eq 0}{$form.details.html|crmAddClass:huge}{else}{$form.details.html}{/if} | |
6a488035 TO |
69 | </td> |
70 | </tr> | |
1156155a P |
71 | {* Added Activity Details accordion tab *} |
72 | <tr class="crm-case-activity-form-block-activity-details"> | |
73 | <td colspan="2"> | |
74 | <div id="activity-details" class="crm-accordion-wrapper collapsed"> | |
75 | <div class="crm-accordion-header"> | |
0256a5d5 | 76 | {ts}Activity Details{/ts} |
1156155a P |
77 | </div><!-- /.crm-accordion-header --> |
78 | <div class="crm-accordion-body"> | |
b7a1560a ML |
79 | {else} |
80 | <tr class="crm-case-activity-form-block-activity-details"> | |
81 | <td colspan="2"> | |
6a488035 | 82 | {/if} |
1156155a | 83 | {* End block for change status, case type and start date. *} |
4d91aee1 P |
84 | <table class="form-layout-compressed"> |
85 | <tbody> | |
86 | <tr id="with-clients" class="crm-case-activity-form-block-client_name"> | |
87 | <td class="label font-size12pt">{ts}Client{/ts}</td> | |
7f7fa13a | 88 | <td class="view-value"> |
4d91aee1 | 89 | <span class="font-size12pt"> |
725fd9d9 N |
90 | {foreach from=$client_names item=client name=clients key=id} |
91 | {foreach from=$client_names.$id item=client1} | |
92 | {$client1.display_name} | |
93 | {/foreach} | |
94 | {if not $smarty.foreach.clients.last}; {/if} | |
4d91aee1 P |
95 | {/foreach} |
96 | </span> | |
6a488035 | 97 | |
725fd9d9 | 98 | {if $action eq 1 or $action eq 2} |
4d91aee1 P |
99 | <br /> |
100 | <a href="#" class="crm-with-contact">» {ts}With other contact(s){/ts}</a> | |
101 | {/if} | |
102 | </td> | |
103 | </tr> | |
6a488035 | 104 | |
4d91aee1 | 105 | {if $action eq 1 or $action eq 2} |
22b67281 | 106 | <tr class="crm-case-activity-form-block-target_contact_id hiddenElement" id="with-contacts-widget"> |
4d91aee1 P |
107 | <td class="label font-size10pt">{ts}With Contact{/ts}</td> |
108 | <td class="view-value"> | |
109 | {$form.target_contact_id.html} | |
110 | <br/> | |
111 | <a href="#" class="crm-with-contact"> | |
112 | » {if not $multiClient}{ts}With client{/ts}{else}{ts}With client(s){/ts}{/if} | |
113 | </a> | |
114 | </td> | |
115 | </tr> | |
116 | {/if} | |
117 | ||
118 | <tr class="crm-case-activity-form-block-activityTypeName"> | |
119 | <td class="label">{ts}Activity Type{/ts}</td> | |
120 | <td class="view-value bold">{$activityTypeName|escape}</td> | |
121 | </tr> | |
122 | <tr class="crm-case-activity-form-block-source_contact_id"> | |
123 | <td class="label">{$form.source_contact_id.label}</td> | |
124 | <td class="view-value">{$form.source_contact_id.html}</td> | |
125 | </tr> | |
126 | <tr class="crm-case-activity-form-block-assignee_contact_id"> | |
127 | <td class="label"> | |
128 | {$form.assignee_contact_id.label} | |
129 | {edit}{help id="assignee_contact_id" title=$form.assignee_contact_id.label file="CRM/Activity/Form/Activity"}{/edit} | |
130 | </td> | |
131 | <td>{$form.assignee_contact_id.html} | |
132 | {if $activityAssigneeNotification} | |
133 | <br /> | |
52604b19 | 134 | <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> |
4d91aee1 P |
135 | {/if} |
136 | </td> | |
137 | </tr> | |
138 | ||
139 | {* Include special processing fields if any are defined for this activity type (e.g. Change Case Status / Change Case Type). *} | |
1156155a | 140 | |
4d91aee1 P |
141 | {if $activityTypeFile neq 'ChangeCaseStartDate'} |
142 | <tr class="crm-case-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 | {/if} | |
146 | <tr class="crm-case-activity-form-block-medium_id"> | |
147 | <td class="label">{$form.medium_id.label}</td> | |
148 | <td class="view-value">{$form.medium_id.html} {$form.location.label} {$form.location.html|crmAddClass:huge}</td> | |
149 | </tr> | |
150 | <tr class="crm-case-activity-form-block-activity_date_time"> | |
151 | <td class="label">{$form.activity_date_time.label}</td> | |
152 | {if $action eq 2 && $activityTypeFile eq 'OpenCase'} | |
153 | <td class="view-value">{$current_activity_date_time|crmDate} | |
154 | <div class="description">Use a <a href="{$changeStartURL}">Change Start Date</a> activity to change the date</div> | |
155 | {* avoid errors about missing field *} | |
156 | <div style="display: none;">{include file="CRM/common/jcalendar.tpl" elementName=activity_date_time}</div> | |
157 | </td> | |
158 | {else} | |
159 | <td class="view-value">{include file="CRM/common/jcalendar.tpl" elementName=activity_date_time}</td> | |
160 | {/if} | |
161 | </tr> | |
162 | <tr> | |
163 | <td colspan="2"><div id="customData"></div></td> | |
164 | </tr> | |
165 | {if NOT $activityTypeFile} | |
166 | <tr class="crm-case-activity-form-block-details"> | |
167 | <td class="label">{$form.details.label}</td> | |
168 | <td class="view-value"> | |
169 | {* If using plain textarea, assign class=huge to make input large enough. *} | |
170 | {if $defaultWysiwygEditor eq 0}{$form.details.html|crmAddClass:huge}{else}{$form.details.html}{/if} | |
171 | </td> | |
172 | </tr> | |
173 | {/if} | |
174 | <tr class="crm-case-activity-form-block-duration"> | |
175 | <td class="label">{$form.duration.label}</td> | |
176 | <td class="view-value"> | |
177 | {$form.duration.html} | |
178 | <span class="description">{ts}minutes{/ts}</span> | |
179 | </td> | |
180 | </tr> | |
181 | </table> | |
1156155a P |
182 | {if $activityTypeFile EQ 'ChangeCaseStatus' |
183 | || $activityTypeFile EQ 'ChangeCaseType' | |
184 | || $activityTypeFile EQ 'ChangeCaseStartDate'} | |
4d91aee1 P |
185 | </div><!-- /.crm-accordion-body --> |
186 | </div><!-- /.crm-accordion-wrapper --> | |
1156155a P |
187 | {* End of Activity Details accordion tab *} |
188 | {/if} | |
6a488035 TO |
189 | </td> |
190 | </tr> | |
27b5f64f | 191 | <tr class="crm-case-activity-form-block-attachment"> |
6a488035 TO |
192 | <td colspan="2">{include file="CRM/Form/attachment.tpl"}</td> |
193 | </tr> | |
194 | {if $searchRows} {* We have got case role rows to display for "Send Copy To" feature *} | |
27b5f64f | 195 | <tr class="crm-case-activity-form-block-send_copy"> |
6a488035 TO |
196 | <td colspan="2"> |
197 | <div id="sendcopy" class="crm-accordion-wrapper collapsed"> | |
198 | <div class="crm-accordion-header"> | |
199 | {ts}Send a Copy{/ts} | |
200 | </div><!-- /.crm-accordion-header --> | |
201 | <div id="sendcopy-body" class="crm-accordion-body"> | |
202 | ||
203 | <div class="description">{ts}Email a complete copy of this activity record to other people involved with the case. Click the top left box to select all.{/ts}</div> | |
204 | {strip} | |
03a2a396 | 205 | <table class="row-highlight"> |
6a488035 TO |
206 | <tr class="columnheader"> |
207 | <th>{$form.toggleSelect.html} </th> | |
208 | <th>{ts}Case Role{/ts}</th> | |
209 | <th>{ts}Name{/ts}</th> | |
210 | <th>{ts}Email{/ts}</th> | |
725fd9d9 | 211 | {if $countId gt 1}<th>{ts}Target Contact{/ts}</th>{/if} |
6a488035 TO |
212 | </tr> |
213 | {foreach from=$searchRows item=row key=id} | |
725fd9d9 N |
214 | {foreach from=$searchRows.$id item=row1 key=id1} |
215 | <tr class="{cycle values="odd-row,even-row"}"> | |
216 | <td class="crm-case-activity-form-block-contact_{$id}">{$form.contact_check[$id].html}</td> | |
217 | <td class="crm-case-activity-form-block-role">{$row1.role}</td> | |
218 | <td class="crm-case-activity-form-block-display_name">{$row1.display_name}</td> | |
219 | <td class="crm-case-activity-form-block-email">{$row1.email}</td> | |
220 | {if $countId gt 1}<td class="crm-case-activity-form-block-display_name">{$row1.managerOf}</td>{/if} | |
221 | </tr> | |
222 | {/foreach} | |
6a488035 TO |
223 | {/foreach} |
224 | </table> | |
225 | {/strip} | |
226 | </div><!-- /.crm-accordion-body --> | |
227 | </div><!-- /.crm-accordion-wrapper --> | |
228 | </td> | |
229 | </tr> | |
230 | {/if} | |
27b5f64f | 231 | <tr class="crm-case-activity-form-block-schedule_followup"> |
6a488035 TO |
232 | <td colspan="2"> |
233 | ||
234 | <div id="follow-up" class="crm-accordion-wrapper collapsed"> | |
235 | <div class="crm-accordion-header"> | |
236 | {ts}Schedule Follow-up{/ts} | |
237 | </div><!-- /.crm-accordion-header --> | |
238 | <div class="crm-accordion-body"> | |
239 | ||
240 | <table class="form-layout-compressed"> | |
241 | <tr class="crm-case-activity-form-block-followup_activity_type_id"> | |
242 | <td class="label">{ts}Schedule Follow-up Activity{/ts}</td> | |
243 | <td>{$form.followup_activity_type_id.html} {ts}on{/ts} | |
244 | {include file="CRM/common/jcalendar.tpl" elementName=followup_date} | |
245 | </td> | |
246 | </tr> | |
247 | <tr class="crm-case-activity-form-block-followup_activity_subject"> | |
248 | <td class="label">{$form.followup_activity_subject.label}</td> | |
249 | <td>{$form.followup_activity_subject.html|crmAddClass:huge}</td> | |
250 | </tr> | |
b7a1560a | 251 | <tr> |
ed5ae6f3 DJ |
252 | <td class="label"> |
253 | {$form.followup_assignee_contact_id.label} | |
254 | {edit} | |
255 | {/edit} | |
256 | </td> | |
257 | <td> | |
258 | {$form.followup_assignee_contact_id.html} | |
259 | </td> | |
260 | </tr> | |
6a488035 TO |
261 | </table> |
262 | </div><!-- /.crm-accordion-body --> | |
263 | </div><!-- /.crm-accordion-wrapper --> | |
264 | </td> | |
265 | </tr> | |
6a488035 TO |
266 | {* Suppress activity status and priority for changes to status, case type and start date. PostProc will force status to completed. *} |
267 | {if $activityTypeFile NEQ 'ChangeCaseStatus' | |
268 | && $activityTypeFile NEQ 'ChangeCaseType' | |
269 | && $activityTypeFile NEQ 'ChangeCaseStartDate'} | |
b7a1560a ML |
270 | <tr> |
271 | <td colspan="2"> | |
272 | <table class="form-layout-compressed"> | |
273 | <tr class="crm-case-activity-form-block-status_id"> | |
274 | <td class="label">{$form.status_id.label}</td><td class="view-value">{$form.status_id.html}</td> | |
275 | </tr> | |
276 | <tr class="crm-case-activity-form-block-priority_id"> | |
277 | <td class="label">{$form.priority_id.label}</td><td class="view-value">{$form.priority_id.html}</td> | |
278 | </tr> | |
279 | </table> | |
280 | </td> | |
b0abeb51 | 281 | </tr> |
6a488035 TO |
282 | {/if} |
283 | {if $form.tag.html} | |
284 | <tr class="crm-case-activity-form-block-tag"> | |
285 | <td class="label">{$form.tag.label}</td> | |
ab345ca5 CW |
286 | <td class="view-value"> |
287 | <div class="crm-select-container">{$form.tag.html}</div> | |
6a488035 TO |
288 | </td> |
289 | </tr> | |
290 | {/if} | |
6d538af3 | 291 | <tr class="crm-case-activity-form-block-tag_set"><td colspan="2">{include file="CRM/common/Tagset.tpl" tagsetType='activity'}</td></tr> |
6a488035 TO |
292 | </table> |
293 | ||
294 | {/if} | |
295 | ||
1476fa4f | 296 | {crmRegion name='case-activity-form'}{/crmRegion} |
8951353f | 297 | |
6a488035 TO |
298 | <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div> |
299 | ||
300 | {if $action eq 1 or $action eq 2} | |
301 | {*include custom data js file*} | |
302 | {include file="CRM/common/customData.tpl"} | |
303 | {literal} | |
304 | <script type="text/javascript"> | |
3cc60a06 | 305 | CRM.$(function($) { |
6a488035 | 306 | {/literal} |
6a488035 TO |
307 | {if $customDataSubType} |
308 | CRM.buildCustomData( '{$customDataType}', {$customDataSubType} ); | |
1c0e2c21 ML |
309 | {else} |
310 | CRM.buildCustomData( '{$customDataType}' ); | |
6a488035 TO |
311 | {/if} |
312 | {literal} | |
313 | }); | |
314 | </script> | |
315 | {/literal} | |
316 | {/if} | |
317 | ||
0256a5d5 | 318 | {if $action neq 8 and $action neq 32768 and empty($activityTypeFile)} |
6a488035 TO |
319 | <script type="text/javascript"> |
320 | {if $searchRows} | |
321 | cj('#sendcopy').crmAccordionToggle(); | |
322 | {/if} | |
323 | ||
324 | cj('#follow-up').crmAccordionToggle(); | |
325 | </script> | |
326 | {/if} | |
327 | ||
6a488035 TO |
328 | {if $action eq 2 or $action eq 1} |
329 | {literal} | |
330 | <script type="text/javascript"> | |
3cc60a06 | 331 | CRM.$(function($) { |
ae8f569f CW |
332 | $('.crm-with-contact').click(function() { |
333 | $('#with-contacts-widget').toggle(); | |
334 | $('#with-clients').toggle(); | |
c27ebe4e | 335 | return false; |
6a488035 TO |
336 | }); |
337 | }); | |
338 | </script> | |
339 | {/literal} | |
340 | {/if} | |
341 | </div> | |
27b5f64f | 342 | {/if} {* end of main if block*} |