Merge branch '4.6' into master
[civicrm-core.git] / templates / CRM / Case / Form / Activity.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2015 |
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 <div class="icon inform-icon"></div> &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 id="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}Notes{/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 class="description"><span class="icon ui-icon-mail-closed"></span>{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 {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>
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">
162 {* If using plain textarea, assign class=huge to make input large enough. *}
163 {if $defaultWysiwygEditor eq 0}{$form.details.html|crmAddClass:huge}{else}{$form.details.html}{/if}
164 </td>
165 </tr>
166 {/if}
167 <tr>
168 <td colspan="2"><div id="customData"></div></td>
169 </tr>
170 {if NOT $activityTypeFile}
171 <tr class="crm-case-activity-form-block-details">
172 <td class="label">{$form.details.label}</td>
173 <td class="view-value">
174 {$form.details.html}
175 </td>
176 </tr>
177 {/if}
178 <tr class="crm-case-activity-form-block-duration">
179 <td class="label">{$form.duration.label}</td>
180 <td class="view-value">
181 {$form.duration.html}
182 <span class="description">{ts}minutes{/ts}</span>
183 </td>
184 </tr>
185 </table>
186 {if $activityTypeFile EQ 'ChangeCaseStatus'
187 || $activityTypeFile EQ 'ChangeCaseType'
188 || $activityTypeFile EQ 'ChangeCaseStartDate'}
189 </div><!-- /.crm-accordion-body -->
190 </div><!-- /.crm-accordion-wrapper -->
191 {* End of Activity Details accordion tab *}
192 {/if}
193 </td>
194 </tr>
195 <tr class="crm-case-activity-form-block-attachment">
196 <td colspan="2">{include file="CRM/Form/attachment.tpl"}</td>
197 </tr>
198 {if $searchRows} {* We have got case role rows to display for "Send Copy To" feature *}
199 <tr class="crm-case-activity-form-block-send_copy">
200 <td colspan="2">
201 <div id="sendcopy" class="crm-accordion-wrapper collapsed">
202 <div class="crm-accordion-header">
203 {ts}Send a Copy{/ts}
204 </div><!-- /.crm-accordion-header -->
205 <div id="sendcopy-body" class="crm-accordion-body">
206
207 <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>
208 {strip}
209 <table class="row-highlight">
210 <tr class="columnheader">
211 <th>{$form.toggleSelect.html}&nbsp;</th>
212 <th>{ts}Case Role{/ts}</th>
213 <th>{ts}Name{/ts}</th>
214 <th>{ts}Email{/ts}</th>
215 {if $countId gt 1}<th>{ts}Target Contact{/ts}</th>{/if}
216 </tr>
217 {foreach from=$searchRows item=row key=id}
218 {foreach from=$searchRows.$id item=row1 key=id1}
219 <tr class="{cycle values="odd-row,even-row"}">
220 <td class="crm-case-activity-form-block-contact_{$id}">{$form.contact_check[$id].html}</td>
221 <td class="crm-case-activity-form-block-role">{$row1.role}</td>
222 <td class="crm-case-activity-form-block-display_name">{$row1.display_name}</td>
223 <td class="crm-case-activity-form-block-email">{$row1.email}</td>
224 {if $countId gt 1}<td class="crm-case-activity-form-block-display_name">{$row1.managerOf}</td>{/if}
225 </tr>
226 {/foreach}
227 {/foreach}
228 </table>
229 {/strip}
230 </div><!-- /.crm-accordion-body -->
231 </div><!-- /.crm-accordion-wrapper -->
232 </td>
233 </tr>
234 {/if}
235 <tr class="crm-case-activity-form-block-schedule_followup">
236 <td colspan="2">
237 {include file="CRM/Activity/Form/FollowUp.tpl" type="case-"}
238 </td>
239 </tr>
240 {* Suppress activity status and priority for changes to status, case type and start date. PostProc will force status to completed. *}
241 {if $activityTypeFile NEQ 'ChangeCaseStatus'
242 && $activityTypeFile NEQ 'ChangeCaseType'
243 && $activityTypeFile NEQ 'ChangeCaseStartDate'}
244 <tr>
245 <td colspan="2">
246 <table class="form-layout-compressed">
247 <tr class="crm-case-activity-form-block-status_id">
248 <td class="label">{$form.status_id.label}</td><td class="view-value">{$form.status_id.html}</td>
249 </tr>
250 <tr class="crm-case-activity-form-block-priority_id">
251 <td class="label">{$form.priority_id.label}</td><td class="view-value">{$form.priority_id.html}</td>
252 </tr>
253 </table>
254 </td>
255 </tr>
256 {/if}
257 {if $form.tag.html}
258 <tr class="crm-case-activity-form-block-tag">
259 <td class="label">{$form.tag.label}</td>
260 <td class="view-value">
261 <div class="crm-select-container">{$form.tag.html}</div>
262 </td>
263 </tr>
264 {/if}
265 <tr class="crm-case-activity-form-block-tag_set"><td colspan="2">{include file="CRM/common/Tagset.tpl" tagsetType='activity'}</td></tr>
266 </table>
267
268 {/if}
269
270 {crmRegion name='case-activity-form'}{/crmRegion}
271
272 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="bottom"}</div>
273
274 {if $action eq 1 or $action eq 2}
275 {*include custom data js file*}
276 {include file="CRM/common/customData.tpl"}
277 {literal}
278 <script type="text/javascript">
279 CRM.$(function($) {
280 {/literal}
281 {if $customDataSubType}
282 CRM.buildCustomData( '{$customDataType}', {$customDataSubType} );
283 {else}
284 CRM.buildCustomData( '{$customDataType}' );
285 {/if}
286 {literal}
287 });
288 </script>
289 {/literal}
290 {/if}
291
292 {if $action neq 8 and $action neq 32768 and empty($activityTypeFile)}
293 <script type="text/javascript">
294 {if $searchRows}
295 cj('#sendcopy').crmAccordionToggle();
296 {/if}
297
298 cj('#follow-up').crmAccordionToggle();
299 </script>
300 {/if}
301
302 {if $action eq 2 or $action eq 1}
303 {literal}
304 <script type="text/javascript">
305 CRM.$(function($) {
306 $('.crm-with-contact').click(function() {
307 $('#with-contacts-widget').toggle();
308 $('#with-clients').toggle();
309 return false;
310 });
311 });
312 </script>
313 {/literal}
314 {/if}
315 </div>