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