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