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