CRM-13966 - Improve search widget style
[civicrm-core.git] / templates / CRM / Activity / Form / Activity.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
232624b1 3 | CiviCRM version 4.4 |
6a488035
TO
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{* this template is used for adding/editing other (custom) activities. *}
27{if $cdType }
28 {include file="CRM/Custom/Form/CustomData.tpl"}
29{else}
30 {if $action eq 4}
31 <div class="crm-block crm-content-block crm-activity-view-block">
32 {else}
33 {if $context NEQ 'standalone'}
da520b85 34 <h3>{if $action eq 1 or $action eq 1024}{ts 1=$activityTypeName}New activity: %1{/ts}{elseif $action eq 8}{ts 1=$activityTypeName}Delete %1{/ts}{else}{ts 1=$activityTypeName}Edit %1{/ts}{/if}</h3>
6a488035
TO
35 {/if}
36 {if $activityTypeDescription }
37 <div class="help">{$activityTypeDescription}</div>
38 {/if}
39 <div class="crm-block crm-form-block crm-activity-form-block">
40 {/if}
41 {* added onload javascript for source contact*}
8707432a 42 {include file="CRM/Activity/Form/ActivityJs.tpl" tokenContext="activity"}
6a488035
TO
43 {if !$action or ( $action eq 1 ) or ( $action eq 2 ) }
44 <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
45 {/if}
46
47 {if $action eq 8} {* Delete action. *}
48 <table class="form-layout">
49 <tr>
50 <td colspan="2">
51 <div class="status">{ts 1=$delName}Are you sure you want to delete '%1'?{/ts}</div>
52 </td>
53 </tr>
54 {elseif $action eq 1 or $action eq 2 or $action eq 4 or $context eq 'search' or $context eq 'smog'}
55
56 <table class="{if $action eq 4}crm-info-panel{else}form-layout{/if}">
57
58 {if $action eq 4}
59 <h3>{$activityTypeName}</h3>
60 {if $activityTypeDescription }
61 <div class="help">{$activityTypeDescription}</div>
edc51caa 62 {/if}
6a488035
TO
63 {else}
64 {if $context eq 'standalone' or $context eq 'search' or $context eq 'smog'}
65 <tr class="crm-activity-form-block-activity_type_id">
66 <td class="label">{$form.activity_type_id.label}</td><td class="view-value">{$form.activity_type_id.html}</td>
67 </tr>
68 {/if}
69 {/if}
70
71 {if $surveyActivity}
72 <tr class="crm-activity-form-block-survey">
73 <td class="label">{ts}Survey Title{/ts}</td><td class="view-value">{$surveyTitle}</td>
74 </tr>
75 {/if}
76
77 <tr class="crm-activity-form-block-source_contact_id">
78 <td class="label">{$form.source_contact_id.label}</td>
79 <td class="view-value">
80 {if $admin and $action neq 4}{$form.source_contact_id.html} {else} {$source_contact_value} {/if}
81 </td>
82 </tr>
83
84 <tr class="crm-activity-form-block-target_contact_id">
85 {if $single eq false}
86 <td class="label">{ts}With Contact(s){/ts}</td>
ef89f226
KJ
87 <td class="view-value" style="white-space: normal">
88 {$with|escape}
89 <br/>
0d4db96c 90 {$form.is_multi_activity.html}&nbsp;{$form.is_multi_activity.label} {help id="id-is_multi_activity"}
ef89f226 91 </td>
6a488035
TO
92 {elseif $action neq 4}
93 <td class="label">{ts}With Contact{/ts}</td>
94 <td class="view-value">
50147a78 95 {include file="CRM/Contact/Form/NewContact.tpl" noLabel=true skipBreak=true multiClient=true parent="activity" showNewSelect=true}
52c7b3a2
KJ
96 {if $action eq 1}
97 <br/>
3efc2908 98 {$form.is_multi_activity.html}&nbsp;{$form.is_multi_activity.label} {help id="id-is_multi_activity"}
52c7b3a2 99 {/if}
6a488035
TO
100 </td>
101 {else}
102 <td class="label">{ts}With Contact{/ts}</td>
103 <td class="view-value" style="white-space: normal">
104 {foreach from=$target_contact key=id item=name}
105 <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$id"}">{$name}</a>;&nbsp;
106 {/foreach}
107 </td>
108 {/if}
109 </tr>
8ef12e64 110
6a488035
TO
111 <tr class="crm-activity-form-block-assignee_contact_id">
112 {if $action eq 4}
113 <td class="label">{ts}Assigned To{/ts}</td><td class="view-value">
114 {foreach from=$assignee_contact key=id item=name}
115 <a href="{crmURL p='civicrm/contact/view' q="reset=1&cid=$id"}">{$name}</a>;&nbsp;
116 {/foreach}
117 </td>
118 {else}
119 <td class="label">{ts}Assigned To{/ts}</td>
8cc24f78
CW
120 <td>
121 <a href="#" class="button" id="swap_target_assignee" title="{ts}Swap Target and Assignee Contacts{/ts}" style="float:right;">
122 <span>
123 <div class="icon swap-icon"></div>
124 </span>
125 </a>
126 {$form.assignee_contact_id.html}
6a488035
TO
127 {edit}
128 <span class="description">{ts}You can optionally assign this activity to someone. Assigned activities will appear in their Activities listing at CiviCRM Home.{/ts}
6db7e202 129 {if $activityAssigneeNotification}
6a488035
TO
130 <br />{ts}A copy of this activity will be emailed to each Assignee.{/ts}
131 {/if}
132 </span>
133 {/edit}
134 </td>
135 {/if}
136 </tr>
137
138 {if $activityTypeFile}
139 {include file="CRM/$crmDir/Form/Activity/$activityTypeFile.tpl"}
140 {/if}
141
142 <tr class="crm-activity-form-block-subject">
143 <td class="label">{$form.subject.label}</td><td class="view-value">{$form.subject.html|crmAddClass:huge}</td>
144 </tr>
145
146 {* CRM-7362 --add campaign to activities *}
147 {include file="CRM/Campaign/Form/addCampaignToComponent.tpl"
148 campaignTrClass="crm-activity-form-block-campaign_id"}
149
150 {* build engagement level CRM-7775 *}
151 {if $buildEngagementLevel}
152 <tr class="crm-activity-form-block-engagement_level">
153 <td class="label">{$form.engagement_level.label}</td>
154 <td class="view-value">{$form.engagement_level.html}</td>
155 </tr>
156 {/if}
157
158 <tr class="crm-activity-form-block-location">
159 <td class="label">{$form.location.label}</td><td class="view-value">{$form.location.html|crmAddClass:huge}</td>
160 </tr>
161 <tr class="crm-activity-form-block-activity_date_time">
162 <td class="label">{$form.activity_date_time.label}</td>
163 {if $action neq 4}
164 <td class="view-value">{include file="CRM/common/jcalendar.tpl" elementName=activity_date_time}</td>
165 {else}
166 <td class="view-value">{$form.activity_date_time.html|crmDate}</td>
167 {/if}
168 </tr>
169 <tr class="crm-activity-form-block-duration">
170 <td class="label">{$form.duration.label}</td>
171 <td class="view-value">
172 {$form.duration.html}
173 {if $action neq 4}<span class="description">{ts}Total time spent on this activity (in minutes).{/ts}{/if}
174 </td>
175 </tr>
176 <tr class="crm-activity-form-block-status_id">
177 <td class="label">{$form.status_id.label}</td><td class="view-value">{$form.status_id.html}</td>
178 </tr>
179 <tr class="crm-activity-form-block-details">
180 <td class="label">{$form.details.label}</td>
181 {if $activityTypeName eq "Print PDF Letter"}
182 <td class="view-value">
183 {* If using plain textarea, assign class=huge to make input large enough. *}
184 {if $defaultWysiwygEditor eq 0}{$form.details.html|crmAddClass:huge}{else}{$form.details.html}{/if}
185 </td>
186 {else}
187 <td class="view-value">
188 {* If using plain textarea, assign class=huge to make input large enough. *}
189 {if $defaultWysiwygEditor eq 0}{$form.details.html|crmStripAlternatives|crmAddClass:huge}{else}{$form.details.html|crmStripAlternatives}{/if}
190 </td>
191 {/if}
192 </tr>
193 <tr class="crm-activity-form-block-priority_id">
194 <td class="label">{$form.priority_id.label}</td><td class="view-value">{$form.priority_id.html}</td>
195 </tr>
196 {if $surveyActivity }
197 <tr class="crm-activity-form-block-result">
198 <td class="label">{$form.result.label}</td><td class="view-value">{$form.result.html}</td>
199 </tr>
200 {/if}
201 {if $form.tag.html}
202 <tr class="crm-activity-form-block-tag">
203 <td class="label">{$form.tag.label}</td>
ab345ca5
CW
204 <td class="view-value">
205 <div class="crm-select-container">{$form.tag.html}</div>
6a488035
TO
206 </td>
207 </tr>
208 {/if}
209
210 {if $tagsetInfo_activity}
211 <tr class="crm-activity-form-block-tag_set"><td colspan="2">{include file="CRM/common/Tag.tpl" tagsetType='activity'}</td></tr>
212 {/if}
213
214 {if $action neq 4 OR $viewCustomData}
215 <tr class="crm-activity-form-block-custom_data">
216 <td colspan="2">
217 {if $action eq 4}
218 {include file="CRM/Custom/Page/CustomDataView.tpl"}
219 {else}
220 <div id="customData"></div>
221 {/if}
222 </td>
223 </tr>
224 {/if}
225
226 {if $action eq 4 AND $currentAttachmentInfo}
227 {include file="CRM/Form/attachment.tpl"}{* For view action the include provides the row and cells. *}
228 {elseif $action eq 1 OR $action eq 2}
229 <tr class="crm-activity-form-block-attachment">
230 <td colspan="2">
231 {include file="CRM/Form/attachment.tpl"}
232 </td>
233 </tr>
234 {/if}
235
236 {if $action neq 4} {* Don't include "Schedule Follow-up" section in View mode. *}
237 <tr class="crm-activity-form-block-schedule_followup">
238 <td colspan="2">
239 <div class="crm-accordion-wrapper collapsed">
240 <div class="crm-accordion-header">
241 {ts}Schedule Follow-up{/ts}
242 </div><!-- /.crm-accordion-header -->
243 <div class="crm-accordion-body">
244 <table class="form-layout-compressed">
245 <tr><td class="label">{ts}Schedule Follow-up Activity{/ts}</td>
246 <td>{$form.followup_activity_type_id.html}&nbsp;&nbsp;{ts}on{/ts}
247 {include file="CRM/common/jcalendar.tpl" elementName=followup_date}
248 </td>
249 </tr>
250 <tr>
251 <td class="label">{$form.followup_activity_subject.label}</td>
252 <td>{$form.followup_activity_subject.html|crmAddClass:huge}</td>
253 </tr>
90b05581
DG
254 <tr>
255 <td class="label">{ts}Assign To{/ts}</td>
256 <td>{$form.followup_assignee_contact_id.html}
257 {edit}<span class="description">{ts}You can optionally assign this activity to someone. Assigned activities will appear in their Activities listing at CiviCRM Home.{/ts}
258 </span>
259 {/edit}
260 </td>
261 </tr>
6a488035
TO
262 </table>
263 </div><!-- /.crm-accordion-body -->
264 </div><!-- /.crm-accordion-wrapper -->
265 {literal}
266 <script type="text/javascript">
267 cj(function() {
268 cj().crmAccordions();
269 cj('.crm-accordion-body').each( function() {
270 //open tab if form rule throws error
271 if ( cj(this).children( ).find('span.crm-error').text( ).length > 0 ) {
272 cj(this).parent('.collapsed').crmAccordionToggle();
273 }
274 });
275 });
9285bb0f
AH
276 cj('#swap_target_assignee').click( function() {
277 var assignees = cj('input#assignee_contact_id').tokenInput("get");
278 var targets = cj('input#contact_1').tokenInput("get");
279 cj('#assignee_contact_id').tokenInput("clear");
280 cj('#contact_1').tokenInput("clear");
281 cj(assignees).each( function() {
282 cj('#contact_1').tokenInput("add", this);
283 });
284 cj(targets).each( function() {
285 cj('#assignee_contact_id').tokenInput("add", this);
286 });
43f7a76f 287 return false;
9285bb0f 288 });
6a488035
TO
289 </script>
290 {/literal}
291 </td>
292 </tr>
293 {/if}
294 {/if} {* End Delete vs. Add / Edit action *}
295 </table>
296 <div class="crm-submit-buttons">
297 {if $action eq 4 && $activityTName neq 'Inbound Email'}
298 {if !$context }
299 {assign var="context" value='activity'}
300 {/if}
301 {if $permission EQ 'edit'}
302 {assign var='urlParams' value="reset=1&atype=$atype&action=update&reset=1&id=$entityID&cid=$contactId&context=$context"}
303 {if ($context eq 'fulltext' || $context eq 'search') && $searchKey}
304 {assign var='urlParams' value="reset=1&atype=$atype&action=update&reset=1&id=$entityID&cid=$contactId&context=$context&key=$searchKey"}
305 {/if}
306 <a href="{crmURL p='civicrm/activity/add' q=$urlParams}" class="edit button" title="{ts}Edit{/ts}"><span><div class="icon edit-icon"></div>{ts}Edit{/ts}</span></a>
307 {/if}
308
309 {if call_user_func(array('CRM_Core_Permission','check'), 'delete activities')}
310 {assign var='urlParams' value="reset=1&atype=$atype&action=delete&reset=1&id=$entityID&cid=$contactId&context=$context"}
311 {if ($context eq 'fulltext' || $context eq 'search') && $searchKey}
312 {assign var='urlParams' value="reset=1&atype=$atype&action=delete&reset=1&id=$entityID&cid=$contactId&context=$context&key=$searchKey"}
313 {/if}
314 <a href="{crmURL p='civicrm/contact/view/activity' q=$urlParams}" class="delete button" title="{ts}Delete{/ts}"><span><div class="icon delete-icon"></div>{ts}Delete{/ts}</span></a>
315 {/if}
316 {/if}
317 {include file="CRM/common/formButtons.tpl" location="bottom"}
318 </div>
319
320 {include file="CRM/Case/Form/ActivityToCase.tpl"}
321
322 {if $action eq 1 or $action eq 2 or $context eq 'search' or $context eq 'smog'}
323 {*include custom data js file*}
324 {include file="CRM/common/customData.tpl"}
325 {literal}
326 <script type="text/javascript">
327 cj(function() {
328 {/literal}
329 {if $customDataSubType}
330 CRM.buildCustomData( '{$customDataType}', {$customDataSubType} );
331 {else}
332 CRM.buildCustomData( '{$customDataType}' );
333 {/if}
334 {literal}
335 });
336 </script>
337 {/literal}
338 {/if}
339 {if ! $form.case_select}
340 {include file="CRM/common/formNavigate.tpl"}
341 {/if}
342 </div>{* end of form block*}
343{/if} {* end of snippet if*}