Move pear/mail from packages to composer.json.
[civicrm-core.git] / templates / CRM / Case / Form / Activity.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 5 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2019 |
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 <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*}
35 {include file="CRM/Activity/Form/ActivityJs.tpl" tokenContext="case_activity"}
36
37 {/if}
38
39 {if $action eq 8 or $action eq 32768 }
40 <div class="messages status no-popup">
41 <i class="crm-i fa-info-circle"></i> &nbsp;
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>
52 <div class="help">{$activityTypeDescription}</div>
53 </tr>
54 {/if}
55 {* Block for change status, case type and start date. *}
56 {if $activityTypeFile EQ 'ChangeCaseStatus'
57 || $activityTypeFile EQ 'ChangeCaseType'
58 || $activityTypeFile EQ 'LinkCases'
59 || $activityTypeFile EQ 'ChangeCaseStartDate'}
60 {include file="CRM/Case/Form/Activity/$activityTypeFile.tpl"}
61 <tr class="crm-case-activity-form-block-details">
62 <td class="label">{ts}Details{/ts}</td>
63 <td class="view-value">
64 {$form.details.html}
65 </td>
66 </tr>
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">
72 {ts}Activity Details{/ts}
73 </div><!-- /.crm-accordion-header -->
74 <div class="crm-accordion-body">
75 {else}
76 <tr class="crm-case-activity-form-block-activity-details">
77 <td colspan="2">
78 {/if}
79 {* End block for change status, case type and start date. *}
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>
84 <td class="view-value">
85 <span class="font-size12pt">
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}
91 {/foreach}
92 </span>
93
94 {if $action eq 1 or $action eq 2}
95 <br />
96 <a href="#" class="crm-with-contact">&raquo; {ts}With other contact(s){/ts}</a>
97 {/if}
98 </td>
99 </tr>
100
101 {if $action eq 1 or $action eq 2}
102 <tr class="crm-case-activity-form-block-target_contact_id hiddenElement" id="with-contacts-widget">
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 />
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>
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). *}
136
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 <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>
154 </tr>
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">
159 {$form.details.html}
160 </td>
161 </tr>
162 {/if}
163 <tr>
164 <td colspan="2">{include file="CRM/common/customDataBlock.tpl"}</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">
170 {$form.details.html}
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>
182 {if $activityTypeFile EQ 'ChangeCaseStatus'
183 || $activityTypeFile EQ 'ChangeCaseType'
184 || $activityTypeFile EQ 'ChangeCaseStartDate'}
185 </div><!-- /.crm-accordion-body -->
186 </div><!-- /.crm-accordion-wrapper -->
187 {* End of Activity Details accordion tab *}
188 {/if}
189 </td>
190 </tr>
191 <tr class="crm-case-activity-form-block-attachment">
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 *}
195 <tr class="crm-case-activity-form-block-send_copy">
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}
205 <table class="row-highlight">
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>
211 {if $countId gt 1}<th>{ts}Target Contact{/ts}</th>{/if}
212 </tr>
213 {foreach from=$searchRows item=row key=id}
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_{$id1}">{$form.contact_check[$id1].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}
223 {/foreach}
224 </table>
225 {/strip}
226 </div><!-- /.crm-accordion-body -->
227 </div><!-- /.crm-accordion-wrapper -->
228 </td>
229 </tr>
230 {/if}
231 <tr class="crm-case-activity-form-block-schedule_followup">
232 <td colspan="2">
233 {include file="CRM/Activity/Form/FollowUp.tpl" type="case-"}
234 </td>
235 </tr>
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'}
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>
251 </tr>
252 {/if}
253 {if $form.tag.html}
254 <tr class="crm-case-activity-form-block-tag">
255 <td class="label">{$form.tag.label}</td>
256 <td class="view-value">
257 <div class="crm-select-container">{$form.tag.html}</div>
258 </td>
259 </tr>
260 {/if}
261 <tr class="crm-case-activity-form-block-tag_set"><td colspan="2">{include file="CRM/common/Tagset.tpl" tagsetType='activity'}</td></tr>
262 </table>
263
264 {/if}
265
266 {crmRegion name='case-activity-form'}{/crmRegion}
267
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}
271 {literal}
272 <script type="text/javascript">
273 CRM.$(function($) {
274 var doNotNotifyAssigneeFor = {/literal}{$doNotNotifyAssigneeFor|@json_encode}{literal};
275 $('#activity_type_id').change(function() {
276 if ($.inArray($(this).val(), doNotNotifyAssigneeFor) != -1) {
277 $('#notify_assignee_msg').hide();
278 }
279 else {
280 $('#notify_assignee_msg').show();
281 }
282 });
283 });
284 </script>
285 {/literal}
286 {/if}
287
288 {if $action neq 8 and $action neq 32768 and empty($activityTypeFile)}
289 <script type="text/javascript">
290 {if $searchRows}
291 cj('#sendcopy').crmAccordionToggle();
292 {/if}
293
294 cj('#follow-up').crmAccordionToggle();
295 </script>
296 {/if}
297
298 {if $action eq 2 or $action eq 1}
299 {literal}
300 <script type="text/javascript">
301 CRM.$(function($) {
302 $('.crm-with-contact').click(function() {
303 $('#with-contacts-widget').toggle();
304 $('#with-clients').toggle();
305 return false;
306 });
307 });
308 </script>
309 {/literal}
310 {/if}
311 </div>