Convert Survey/Petition to standard customData template
[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>
d104311a
CW
148 <td class="view-value">
149 {$form.activity_date_time.html}
150 {if $action eq 2 && $activityTypeFile eq 'OpenCase'}
151 <div class="description">Use a <a class="open-inline" href="{$changeStartURL}">Change Start Date</a> activity to change the date</div>
152 {/if}
153 </td>
4d91aee1 154 </tr>
a90cbdea
JM
155 {if $action eq 2 && $activityTypeFile eq 'OpenCase'}
156 <tr class="crm-case-activity-form-block-details">
157 <td class="label">{ts}Notes{/ts}</td>
158 <td class="view-value">
8a80aaf4 159 {$form.details.html}
a90cbdea
JM
160 </td>
161 </tr>
162 {/if}
4d91aee1
P
163 <tr>
164 <td colspan="2"><div id="customData"></div></td>
165 </tr>
166 {if NOT $activityTypeFile}
167 <tr class="crm-case-activity-form-block-details">
168 <td class="label">{$form.details.label}</td>
169 <td class="view-value">
13d9bc82 170 {$form.details.html}
4d91aee1
P
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}&nbsp;</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"}">
ee1ccac5 216 <td class="crm-case-activity-form-block-contact_{$id1}">{$form.contact_check[$id1].html}</td>
725fd9d9
N
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 232 <td colspan="2">
cfcf9132 233 {include file="CRM/Activity/Form/FollowUp.tpl" type="case-"}
6a488035
TO
234 </td>
235 </tr>
6a488035
TO
236 {* Suppress activity status and priority for changes to status, case type and start date. PostProc will force status to completed. *}
237 {if $activityTypeFile NEQ 'ChangeCaseStatus'
238 && $activityTypeFile NEQ 'ChangeCaseType'
239 && $activityTypeFile NEQ 'ChangeCaseStartDate'}
b7a1560a
ML
240 <tr>
241 <td colspan="2">
242 <table class="form-layout-compressed">
243 <tr class="crm-case-activity-form-block-status_id">
244 <td class="label">{$form.status_id.label}</td><td class="view-value">{$form.status_id.html}</td>
245 </tr>
246 <tr class="crm-case-activity-form-block-priority_id">
247 <td class="label">{$form.priority_id.label}</td><td class="view-value">{$form.priority_id.html}</td>
248 </tr>
249 </table>
250 </td>
b0abeb51 251 </tr>
6a488035
TO
252 {/if}
253 {if $form.tag.html}
254 <tr class="crm-case-activity-form-block-tag">
255 <td class="label">{$form.tag.label}</td>
ab345ca5
CW
256 <td class="view-value">
257 <div class="crm-select-container">{$form.tag.html}</div>
6a488035
TO
258 </td>
259 </tr>
260 {/if}
6d538af3 261 <tr class="crm-case-activity-form-block-tag_set"><td colspan="2">{include file="CRM/common/Tagset.tpl" tagsetType='activity'}</td></tr>
6a488035
TO
262 </table>
263
264 {/if}
265
1476fa4f 266{crmRegion name='case-activity-form'}{/crmRegion}
8951353f 267
6a488035
TO
268<div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
269
270 {if $action eq 1 or $action eq 2}
e680ea41
JP
271 {*include custom data js file*}
272 {include file="CRM/common/customData.tpl"}
6a488035
TO
273 {literal}
274 <script type="text/javascript">
3cc60a06 275 CRM.$(function($) {
b8ad9c84 276 var doNotNotifyAssigneeFor = {/literal}{$doNotNotifyAssigneeFor|@json_encode}{literal};
e680ea41
JP
277 $('#activity_type_id').change(function() {
278 if ($.inArray($(this).val(), doNotNotifyAssigneeFor) != -1) {
279 $('#notify_assignee_msg').hide();
280 }
281 else {
282 $('#notify_assignee_msg').show();
283 }
284 });
285
286 {/literal}
287 {if $customDataSubType}
288 CRM.buildCustomData( '{$customDataType}', {$customDataSubType} );
289 {else}
290 CRM.buildCustomData( '{$customDataType}' );
291 {/if}
292 {literal}
6a488035
TO
293 });
294 </script>
295 {/literal}
296 {/if}
297
0256a5d5 298 {if $action neq 8 and $action neq 32768 and empty($activityTypeFile)}
6a488035
TO
299 <script type="text/javascript">
300 {if $searchRows}
301 cj('#sendcopy').crmAccordionToggle();
302 {/if}
303
304 cj('#follow-up').crmAccordionToggle();
305 </script>
306 {/if}
307
6a488035
TO
308 {if $action eq 2 or $action eq 1}
309 {literal}
310 <script type="text/javascript">
3cc60a06 311 CRM.$(function($) {
ae8f569f
CW
312 $('.crm-with-contact').click(function() {
313 $('#with-contacts-widget').toggle();
314 $('#with-clients').toggle();
c27ebe4e 315 return false;
6a488035
TO
316 });
317 });
318 </script>
319 {/literal}
320 {/if}
321</div>