Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | {* |
2 | +--------------------------------------------------------------------+ | |
1188c7a8 | 3 | | Copyright CiviCRM LLC. All rights reserved. | |
6a488035 | 4 | | | |
1188c7a8 TO |
5 | | This work is published under the GNU AGPLv3 license with some | |
6 | | permitted exceptions and without any warranty. For full license | | |
7 | | and copyright information, see https://civicrm.org/licensing | | |
6a488035 TO |
8 | +--------------------------------------------------------------------+ |
9 | *} | |
10 | ||
11 | {* this template is used for adding/editing activities for a case. *} | |
6a488035 TO |
12 | <div class="crm-block crm-form-block crm-case-activity-form-block"> |
13 | ||
14 | {if $action neq 8 and $action neq 32768 } | |
15 | {* Include form buttons on top for new and edit modes. *} | |
16 | <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div> | |
6a488035 TO |
17 | {/if} |
18 | ||
19 | {if $action eq 8 or $action eq 32768 } | |
20 | <div class="messages status no-popup"> | |
13a3d214 | 21 | <i class="crm-i fa-info-circle" aria-hidden="true"></i> |
6a488035 | 22 | {if $action eq 8} |
f3a784bb | 23 | {* activityTypeName means label here not name, but it's ok because label is desired here (dev/core#1116-ok-label) *} |
6a488035 TO |
24 | {ts 1=$activityTypeName}Click Delete to move this "%1" activity to the Trash.{/ts} |
25 | {else} | |
f3a784bb | 26 | {* activityTypeName means label here not name, but it's ok because label is desired here (dev/core#1116-ok-label) *} |
6a488035 TO |
27 | {ts 1=$activityTypeName}Click Restore to retrieve this "%1" activity from the Trash.{/ts} |
28 | {/if} | |
29 | </div><br /> | |
30 | {else} | |
31 | <table class="form-layout"> | |
32 | {if $activityTypeDescription } | |
33 | <tr> | |
f6eedce7 | 34 | <div class="help">{$activityTypeDescription}</div> |
6a488035 TO |
35 | </tr> |
36 | {/if} | |
1156155a P |
37 | {* Block for change status, case type and start date. *} |
38 | {if $activityTypeFile EQ 'ChangeCaseStatus' | |
39 | || $activityTypeFile EQ 'ChangeCaseType' | |
251924af | 40 | || $activityTypeFile EQ 'LinkCases' |
1156155a | 41 | || $activityTypeFile EQ 'ChangeCaseStartDate'} |
4d91aee1 P |
42 | {include file="CRM/Case/Form/Activity/$activityTypeFile.tpl"} |
43 | <tr class="crm-case-activity-form-block-details"> | |
47a3c68a | 44 | <td class="label">{ts}Details{/ts}</td> |
6a488035 | 45 | <td class="view-value"> |
13d9bc82 | 46 | {$form.details.html} |
6a488035 TO |
47 | </td> |
48 | </tr> | |
1156155a P |
49 | {* Added Activity Details accordion tab *} |
50 | <tr class="crm-case-activity-form-block-activity-details"> | |
51 | <td colspan="2"> | |
52 | <div id="activity-details" class="crm-accordion-wrapper collapsed"> | |
53 | <div class="crm-accordion-header"> | |
0256a5d5 | 54 | {ts}Activity Details{/ts} |
1156155a P |
55 | </div><!-- /.crm-accordion-header --> |
56 | <div class="crm-accordion-body"> | |
b7a1560a ML |
57 | {else} |
58 | <tr class="crm-case-activity-form-block-activity-details"> | |
59 | <td colspan="2"> | |
6a488035 | 60 | {/if} |
1156155a | 61 | {* End block for change status, case type and start date. *} |
4d91aee1 P |
62 | <table class="form-layout-compressed"> |
63 | <tbody> | |
64 | <tr id="with-clients" class="crm-case-activity-form-block-client_name"> | |
65 | <td class="label font-size12pt">{ts}Client{/ts}</td> | |
7f7fa13a | 66 | <td class="view-value"> |
4d91aee1 | 67 | <span class="font-size12pt"> |
725fd9d9 N |
68 | {foreach from=$client_names item=client name=clients key=id} |
69 | {foreach from=$client_names.$id item=client1} | |
70 | {$client1.display_name} | |
71 | {/foreach} | |
72 | {if not $smarty.foreach.clients.last}; {/if} | |
4d91aee1 P |
73 | {/foreach} |
74 | </span> | |
6a488035 | 75 | |
725fd9d9 | 76 | {if $action eq 1 or $action eq 2} |
4d91aee1 | 77 | <br /> |
13a3d214 | 78 | <a href="#" class="crm-with-contact"><i class="crm-i fa-user-plus" aria-hidden="true"></i> {ts}With other contact(s){/ts}</a> |
4d91aee1 P |
79 | {/if} |
80 | </td> | |
81 | </tr> | |
6a488035 | 82 | |
4d91aee1 | 83 | {if $action eq 1 or $action eq 2} |
22b67281 | 84 | <tr class="crm-case-activity-form-block-target_contact_id hiddenElement" id="with-contacts-widget"> |
4d91aee1 P |
85 | <td class="label font-size10pt">{ts}With Contact{/ts}</td> |
86 | <td class="view-value"> | |
87 | {$form.target_contact_id.html} | |
88 | <br/> | |
89 | <a href="#" class="crm-with-contact"> | |
13a3d214 | 90 | <i class="crm-i fa-user" aria-hidden="true"></i> {if not $multiClient}{ts}With client{/ts}{else}{ts}With client(s){/ts}{/if} |
4d91aee1 P |
91 | </a> |
92 | </td> | |
93 | </tr> | |
94 | {/if} | |
95 | ||
96 | <tr class="crm-case-activity-form-block-activityTypeName"> | |
97 | <td class="label">{ts}Activity Type{/ts}</td> | |
f3a784bb | 98 | {* activityTypeName means label here not name, but it's ok because label is desired here (dev/core#1116-ok-label) *} |
4d91aee1 P |
99 | <td class="view-value bold">{$activityTypeName|escape}</td> |
100 | </tr> | |
101 | <tr class="crm-case-activity-form-block-source_contact_id"> | |
102 | <td class="label">{$form.source_contact_id.label}</td> | |
103 | <td class="view-value">{$form.source_contact_id.html}</td> | |
104 | </tr> | |
105 | <tr class="crm-case-activity-form-block-assignee_contact_id"> | |
106 | <td class="label"> | |
107 | {$form.assignee_contact_id.label} | |
108 | {edit}{help id="assignee_contact_id" title=$form.assignee_contact_id.label file="CRM/Activity/Form/Activity"}{/edit} | |
109 | </td> | |
110 | <td>{$form.assignee_contact_id.html} | |
111 | {if $activityAssigneeNotification} | |
112 | <br /> | |
13a3d214 | 113 | <span id="notify_assignee_msg" class="description"><i class="crm-i fa-paper-plane" aria-hidden="true"></i> {ts}A copy of this activity will be emailed to each Assignee.{/ts}</span> |
4d91aee1 P |
114 | {/if} |
115 | </td> | |
116 | </tr> | |
117 | ||
118 | {* Include special processing fields if any are defined for this activity type (e.g. Change Case Status / Change Case Type). *} | |
1156155a | 119 | |
4d91aee1 P |
120 | {if $activityTypeFile neq 'ChangeCaseStartDate'} |
121 | <tr class="crm-case-activity-form-block-subject"> | |
122 | <td class="label">{$form.subject.label}</td><td class="view-value">{$form.subject.html|crmAddClass:huge}</td> | |
123 | </tr> | |
124 | {/if} | |
125 | <tr class="crm-case-activity-form-block-medium_id"> | |
126 | <td class="label">{$form.medium_id.label}</td> | |
127 | <td class="view-value">{$form.medium_id.html} {$form.location.label} {$form.location.html|crmAddClass:huge}</td> | |
128 | </tr> | |
129 | <tr class="crm-case-activity-form-block-activity_date_time"> | |
130 | <td class="label">{$form.activity_date_time.label}</td> | |
d104311a CW |
131 | <td class="view-value"> |
132 | {$form.activity_date_time.html} | |
133 | {if $action eq 2 && $activityTypeFile eq 'OpenCase'} | |
134 | <div class="description">Use a <a class="open-inline" href="{$changeStartURL}">Change Start Date</a> activity to change the date</div> | |
135 | {/if} | |
136 | </td> | |
4d91aee1 | 137 | </tr> |
a90cbdea JM |
138 | {if $action eq 2 && $activityTypeFile eq 'OpenCase'} |
139 | <tr class="crm-case-activity-form-block-details"> | |
140 | <td class="label">{ts}Notes{/ts}</td> | |
141 | <td class="view-value"> | |
8a80aaf4 | 142 | {$form.details.html} |
a90cbdea JM |
143 | </td> |
144 | </tr> | |
145 | {/if} | |
4d91aee1 | 146 | <tr> |
cc3dbc01 | 147 | <td colspan="2">{include file="CRM/common/customDataBlock.tpl"}</td> |
4d91aee1 P |
148 | </tr> |
149 | {if NOT $activityTypeFile} | |
150 | <tr class="crm-case-activity-form-block-details"> | |
151 | <td class="label">{$form.details.label}</td> | |
152 | <td class="view-value"> | |
13d9bc82 | 153 | {$form.details.html} |
4d91aee1 P |
154 | </td> |
155 | </tr> | |
156 | {/if} | |
157 | <tr class="crm-case-activity-form-block-duration"> | |
158 | <td class="label">{$form.duration.label}</td> | |
159 | <td class="view-value"> | |
160 | {$form.duration.html} | |
161 | <span class="description">{ts}minutes{/ts}</span> | |
162 | </td> | |
163 | </tr> | |
164 | </table> | |
1156155a P |
165 | {if $activityTypeFile EQ 'ChangeCaseStatus' |
166 | || $activityTypeFile EQ 'ChangeCaseType' | |
167 | || $activityTypeFile EQ 'ChangeCaseStartDate'} | |
4d91aee1 P |
168 | </div><!-- /.crm-accordion-body --> |
169 | </div><!-- /.crm-accordion-wrapper --> | |
1156155a P |
170 | {* End of Activity Details accordion tab *} |
171 | {/if} | |
6a488035 TO |
172 | </td> |
173 | </tr> | |
27b5f64f | 174 | <tr class="crm-case-activity-form-block-attachment"> |
6a488035 TO |
175 | <td colspan="2">{include file="CRM/Form/attachment.tpl"}</td> |
176 | </tr> | |
177 | {if $searchRows} {* We have got case role rows to display for "Send Copy To" feature *} | |
27b5f64f | 178 | <tr class="crm-case-activity-form-block-send_copy"> |
6a488035 TO |
179 | <td colspan="2"> |
180 | <div id="sendcopy" class="crm-accordion-wrapper collapsed"> | |
181 | <div class="crm-accordion-header"> | |
182 | {ts}Send a Copy{/ts} | |
183 | </div><!-- /.crm-accordion-header --> | |
184 | <div id="sendcopy-body" class="crm-accordion-body"> | |
185 | ||
186 | <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> | |
187 | {strip} | |
03a2a396 | 188 | <table class="row-highlight"> |
6a488035 TO |
189 | <tr class="columnheader"> |
190 | <th>{$form.toggleSelect.html} </th> | |
191 | <th>{ts}Case Role{/ts}</th> | |
192 | <th>{ts}Name{/ts}</th> | |
193 | <th>{ts}Email{/ts}</th> | |
725fd9d9 | 194 | {if $countId gt 1}<th>{ts}Target Contact{/ts}</th>{/if} |
6a488035 TO |
195 | </tr> |
196 | {foreach from=$searchRows item=row key=id} | |
725fd9d9 N |
197 | {foreach from=$searchRows.$id item=row1 key=id1} |
198 | <tr class="{cycle values="odd-row,even-row"}"> | |
ee1ccac5 | 199 | <td class="crm-case-activity-form-block-contact_{$id1}">{$form.contact_check[$id1].html}</td> |
725fd9d9 N |
200 | <td class="crm-case-activity-form-block-role">{$row1.role}</td> |
201 | <td class="crm-case-activity-form-block-display_name">{$row1.display_name}</td> | |
202 | <td class="crm-case-activity-form-block-email">{$row1.email}</td> | |
203 | {if $countId gt 1}<td class="crm-case-activity-form-block-display_name">{$row1.managerOf}</td>{/if} | |
204 | </tr> | |
205 | {/foreach} | |
6a488035 TO |
206 | {/foreach} |
207 | </table> | |
208 | {/strip} | |
209 | </div><!-- /.crm-accordion-body --> | |
210 | </div><!-- /.crm-accordion-wrapper --> | |
211 | </td> | |
212 | </tr> | |
213 | {/if} | |
27b5f64f | 214 | <tr class="crm-case-activity-form-block-schedule_followup"> |
6a488035 | 215 | <td colspan="2"> |
cfcf9132 | 216 | {include file="CRM/Activity/Form/FollowUp.tpl" type="case-"} |
6a488035 TO |
217 | </td> |
218 | </tr> | |
6a488035 TO |
219 | {* Suppress activity status and priority for changes to status, case type and start date. PostProc will force status to completed. *} |
220 | {if $activityTypeFile NEQ 'ChangeCaseStatus' | |
221 | && $activityTypeFile NEQ 'ChangeCaseType' | |
222 | && $activityTypeFile NEQ 'ChangeCaseStartDate'} | |
b7a1560a ML |
223 | <tr> |
224 | <td colspan="2"> | |
225 | <table class="form-layout-compressed"> | |
226 | <tr class="crm-case-activity-form-block-status_id"> | |
227 | <td class="label">{$form.status_id.label}</td><td class="view-value">{$form.status_id.html}</td> | |
228 | </tr> | |
229 | <tr class="crm-case-activity-form-block-priority_id"> | |
230 | <td class="label">{$form.priority_id.label}</td><td class="view-value">{$form.priority_id.html}</td> | |
231 | </tr> | |
232 | </table> | |
233 | </td> | |
b0abeb51 | 234 | </tr> |
6a488035 | 235 | {/if} |
633ce286 | 236 | {if !empty($form.tag.html)} |
6a488035 TO |
237 | <tr class="crm-case-activity-form-block-tag"> |
238 | <td class="label">{$form.tag.label}</td> | |
ab345ca5 CW |
239 | <td class="view-value"> |
240 | <div class="crm-select-container">{$form.tag.html}</div> | |
6a488035 TO |
241 | </td> |
242 | </tr> | |
243 | {/if} | |
6d538af3 | 244 | <tr class="crm-case-activity-form-block-tag_set"><td colspan="2">{include file="CRM/common/Tagset.tpl" tagsetType='activity'}</td></tr> |
6a488035 TO |
245 | </table> |
246 | ||
247 | {/if} | |
248 | ||
1476fa4f | 249 | {crmRegion name='case-activity-form'}{/crmRegion} |
8951353f | 250 | |
6a488035 TO |
251 | <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div> |
252 | ||
253 | {if $action eq 1 or $action eq 2} | |
6a488035 TO |
254 | {literal} |
255 | <script type="text/javascript"> | |
cc3dbc01 MWMC |
256 | CRM.$(function($) { |
257 | var doNotNotifyAssigneeFor = {/literal}{$doNotNotifyAssigneeFor|@json_encode}{literal}; | |
258 | $('#activity_type_id').change(function() { | |
259 | if ($.inArray($(this).val(), doNotNotifyAssigneeFor) != -1) { | |
260 | $('#notify_assignee_msg').hide(); | |
261 | } | |
262 | else { | |
263 | $('#notify_assignee_msg').show(); | |
264 | } | |
265 | }); | |
e680ea41 | 266 | }); |
6a488035 TO |
267 | </script> |
268 | {/literal} | |
269 | {/if} | |
270 | ||
0256a5d5 | 271 | {if $action neq 8 and $action neq 32768 and empty($activityTypeFile)} |
6a488035 TO |
272 | <script type="text/javascript"> |
273 | {if $searchRows} | |
274 | cj('#sendcopy').crmAccordionToggle(); | |
275 | {/if} | |
276 | ||
277 | cj('#follow-up').crmAccordionToggle(); | |
278 | </script> | |
279 | {/if} | |
280 | ||
6a488035 TO |
281 | {if $action eq 2 or $action eq 1} |
282 | {literal} | |
283 | <script type="text/javascript"> | |
3cc60a06 | 284 | CRM.$(function($) { |
ae8f569f CW |
285 | $('.crm-with-contact').click(function() { |
286 | $('#with-contacts-widget').toggle(); | |
287 | $('#with-clients').toggle(); | |
c27ebe4e | 288 | return false; |
6a488035 TO |
289 | }); |
290 | }); | |
291 | </script> | |
292 | {/literal} | |
293 | {/if} | |
294 | </div> |