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