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