CRM-16353 - Remaining Contact DataTables refactoring, in addition to initial refactoring
[civicrm-core.git] / templates / CRM / Activity / Selector / Selector.tpl
1 {*
2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2015 |
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 <div class="crm-activity-selector-{$context}">
28 <div class="crm-accordion-wrapper crm-search_filters-accordion">
29 <div class="crm-accordion-header">
30 {ts}Filter by Activity Type{/ts}</a>
31 </div><!-- /.crm-accordion-header -->
32 <div class="crm-accordion-body">
33 <div class="no-border form-layout-compressed activity-search-options">
34 <div class="crm-contact-form-block-activity_type_filter_id crm-inline-edit-field">
35 {$form.activity_type_filter_id.label} {$form.activity_type_filter_id.html|crmAddClass:big}
36 </div>
37 <div class="crm-contact-form-block-activity_type_exclude_filter_id crm-inline-edit-field">
38 {$form.activity_type_exclude_filter_id.label} {$form.activity_type_exclude_filter_id.html|crmAddClass:big}
39 </div>
40 </div>
41 </div><!-- /.crm-accordion-body -->
42 </div><!-- /.crm-accordion-wrapper -->
43 <table class="contact-activity-selector-{$context} crm-ajax-table" data-order='[[5,"desc"]]'>
44 <thead>
45 <tr>
46 <th data-data="activity_type" class="crm-contact-activity-activity_type">{ts}Type{/ts}</th>
47 <th data-data="subject" cell-class="crmf-subject crm-editable" class="crm-contact-activity_subject">{ts}Subject{/ts}</th>
48 <th data-data="source_contact_name" class="crm-contact-activity-source_contact">{ts}Added By{/ts}</th>
49 <th data-data="target_contact_name" data-orderable="false" class="crm-contact-activity-target_contact">{ts}With{/ts}</th>
50 <th data-data="assignee_contact_name" data-orderable="false" class="crm-contact-activity-assignee_contact">{ts}Assigned{/ts}</th>
51 <th data-data="activity_date_time" class="crm-contact-activity-activity_date">{ts}Date{/ts}</th>
52 <th data-data="status_id" cell-class="crmf-status_id crm-editable" cell-data-type="select" cell-data-refresh="true" class="crm-contact-activity-activity_status">{ts}Status{/ts}</th>
53 <th data-data="links" data-orderable="false" class="crm-contact-activity-links">&nbsp;</th>
54 </tr>
55 </thead>
56 </table>
57
58 {literal}
59 <script type="text/javascript">
60 (function($) {
61 CRM.$('table.contact-activity-selector-activity').data({
62 "ajax": {
63 "url": {/literal}'{crmURL p="civicrm/ajax/contactactivity" h=0 q="snippet=4&context=$context&cid=$contactId"}'{literal},
64 "data": function (d) {
65 d.activity_type_id = $('.crm-activity-selector-activity select#activity_type_filter_id').val(),
66 d.activity_type_exclude_id = $('.crm-activity-selector-activity select#activity_type_exclude_filter_id').val()
67 }
68 }
69 });
70 $(function($) {
71 $('.activity-search-options :input').change(function(){
72 CRM.$('.contact-activity-selector-activity').DataTable().draw();
73 });
74 });
75 })(CRM.$);
76 </script>
77 {/literal}
78 </div>
79 {include file="CRM/Case/Form/ActivityToCase.tpl" contactID=$contactId}