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