Merge pull request #14486 from seamuslee001/contribution_date_search_561
[civicrm-core.git] / templates / CRM / Case / Page / DashboardSelector.tpl
CommitLineData
6a488035
TO
1{*
2 +--------------------------------------------------------------------+
fee14197 3 | CiviCRM version 5 |
6a488035 4 +--------------------------------------------------------------------+
6b83d5bd 5 | Copyright CiviCRM LLC (c) 2004-2019 |
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{capture assign=expandIconURL}<img src="{$config->resourceBase}i/TreePlus.gif" alt="{ts}open section{/ts}"/>{/capture}
27{strip}
5f1c8c57 28<table class="case-selector-{$list} crm-ajax-table" data-page-length='10'>
29<thead>
30 <tr>
31 <th data-data="activity_list" data-orderable="false" class="crm-case-activity_list"></th>
32 <th data-data="contact_id" class="crm-case-contact">{ts}Contact{/ts}</th>
33 <th data-data="subject" cell-class="crmf-subject crm-editable" class="crm-case-subject">{ts}Subject{/ts}</th>
34 <th data-data="case_status" class="crm-case-status">{ts}Status{/ts}</th>
35 <th data-data="case_type" class="crm-case-type">{ts}Type{/ts}</th>
36 <th data-data="case_role" class="crm-case-role">{ts}My Role{/ts}</th>
37 <th data-data="manager" data-orderable="false" class="crm-case-manager">{ts}Manager{/ts}</th>
38 <th data-data="date" cell-class="crm-case-date">{if $list EQ 'upcoming'}{ts}Next Sched.{/ts}{elseif $list EQ 'recent'}{ts}Most Recent{/ts}{/if}</th>
39 <th data-data="links" data-orderable="false" class="crm-case-links">&nbsp;</th>
6a488035 40 </tr>
5f1c8c57 41</thead>
42</table>
6a488035 43
5f1c8c57 44{literal}
45 <script type="text/javascript">
46 (function($) {
47 var list = {/literal}"{$list}"{literal};
48 var selectorClass = '.case-selector-' + list;
49 var filterClass = '.case-search-options-' + list;
6a488035 50
5f1c8c57 51 CRM.$('table' + selectorClass).data({
52 "ajax": {
53 "url": {/literal}'{crmURL p="civicrm/ajax/get-cases" h=0 q="snippet=4&all=`$all`"}'{literal},
54 "data": function (d) {
55 d.type = (!$("input[name='upcoming']").length) ? list : $("input[name='upcoming']").prop('checked') ? 'upcoming' : 'any';
56 d.case_type_id = $(filterClass + ' select#case_type_id').val() || [];
57 d.case_type_id = d.case_type_id.join(',');
58 d.status_id = $(filterClass + ' select#case_status_id').val() || [];
59 d.status_id = d.status_id.join(',');
60 }
61 }
62 });
63 $(function($) {
64 $(filterClass + ' :input').change(function() {
65 CRM.$('table' + selectorClass).DataTable().draw();
66 });
67 });
68 })(CRM.$);
69 </script>
70{/literal}
6a488035 71
6a488035 72{/strip}
38502d98 73{crmScript file='js/crm.expandRow.js'}