Commit | Line | Data |
---|---|---|
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 | <div class="crm-block crm-form-block crm-batch-search-form-block"> | |
27 | <h3>{ts}Data Entry Batches{/ts}</h3> | |
28 | <table class="form-layout-compressed"> | |
29 | <tr> | |
30 | <td> | |
31 | {$form.title.html}<br /> | |
32 | <span class="description font-italic"> | |
33 | {ts}Complete OR partial batch name.{/ts} | |
34 | </span> | |
35 | </td> | |
36 | <td>{$form.buttons.html}</td> | |
37 | </tr> | |
38 | </table> | |
39 | </div> | |
40 | <div class="crm-submit-buttons"> | |
41 | <a accesskey="N" href="{crmURL p='civicrm/batch/add' q='reset=1&action=add'}" id="newBatch" class="button"><span><div class="icon add-icon"></div>{ts}New Data Entry Batch{/ts}</span></a><br/> | |
42 | </div> | |
43 | <table id="crm-batch-selector"> | |
44 | <thead> | |
45 | <tr> | |
46 | <th class="crm-batch-name">{ts}Batch Name{/ts}</th> | |
47 | <th class="crm-batch-type">{ts}Type{/ts}</th> | |
48 | <th class="crm-batch-item_count">{ts}Item Count{/ts}</th> | |
49 | <th class="crm-batch-total_amount">{ts}Total Amount{/ts}</th> | |
50 | <th class="crm-batch-status">{ts}Status{/ts}</th> | |
51 | <th class="crm-batch-created_by">{ts}Created By{/ts}</th> | |
52 | <th></th> | |
53 | </tr> | |
54 | </thead> | |
55 | </table> | |
56 | ||
57 | {literal} | |
58 | <script type="text/javascript"> | |
59 | cj( function() { | |
60 | buildBatchSelector( false ); | |
61 | cj('#_qf_Search_refresh').click( function() { | |
62 | buildBatchSelector(true); | |
63 | }); | |
64 | }); | |
65 | ||
66 | function buildBatchSelector( filterSearch ) { | |
67 | var status = {/literal}{$status}{literal}; | |
68 | if (filterSearch) { | |
69 | crmBatchSelector.fnDestroy(); | |
70 | var ZeroRecordText = '<div class="status messages">{/literal}{ts escape="js"}No matching Data Entry Batches found for your search criteria.{/ts}{literal}</li></ul></div>'; | |
71 | } | |
72 | else if (status == 1) { | |
73 | var ZeroRecordText = {/literal}'<div class="status messages">{ts escape="js"}You do not have any Open Data Entry Batches.{/ts}</div>'{literal}; | |
74 | } | |
75 | else { | |
76 | var ZeroRecordText = {/literal}'<div class="status messages">{ts escape="js"}No Data Entry Batches have been created for this site.{/ts}</div>'{literal}; | |
77 | } | |
78 | ||
79 | var columns = ''; | |
80 | var sourceUrl = {/literal}'{crmURL p="civicrm/ajax/batchlist" h=0 q="snippet=4"}'{literal}; | |
81 | ||
82 | crmBatchSelector = cj('#crm-batch-selector').dataTable({ | |
83 | "bFilter" : false, | |
84 | "bAutoWidth" : false, | |
85 | "aaSorting" : [], | |
86 | "aoColumns" : [ | |
87 | {sClass:'crm-batch-name'}, | |
88 | {sClass:'crm-batch-type'}, | |
89 | {sClass:'crm-batch-item_count right'}, | |
90 | {sClass:'crm-batch-total_amount right'}, | |
91 | {sClass:'crm-batch-status'}, | |
92 | {sClass:'crm-batch-created_by'}, | |
93 | {sClass:'crm-batch-links', bSortable:false} | |
94 | ], | |
95 | "bProcessing": true, | |
96 | "asStripClasses" : [ "odd-row", "even-row" ], | |
97 | "sPaginationType": "full_numbers", | |
98 | "sDom" : '<"crm-datatable-pager-top"lfp>rt<"crm-datatable-pager-bottom"ip>', | |
99 | "bServerSide": true, | |
100 | "bJQueryUI": true, | |
101 | "sAjaxSource": sourceUrl, | |
102 | "iDisplayLength": 25, | |
103 | "oLanguage": { "sZeroRecords": ZeroRecordText, | |
104 | "sProcessing": {/literal}"{ts escape='js'}Processing...{/ts}"{literal}, | |
105 | "sLengthMenu": {/literal}"{ts escape='js'}Show _MENU_ entries{/ts}"{literal}, | |
106 | "sInfo": {/literal}"{ts escape='js'}Showing _START_ to _END_ of _TOTAL_ entries{/ts}"{literal}, | |
107 | "sInfoEmpty": {/literal}"{ts escape='js'}Showing 0 to 0 of 0 entries{/ts}"{literal}, | |
108 | "sInfoFiltered": {/literal}"{ts escape='js'}(filtered from _MAX_ total entries){/ts}"{literal}, | |
109 | "sSearch": {/literal}"{ts escape='js'}Search:{/ts}"{literal}, | |
110 | "oPaginate": { | |
111 | "sFirst": {/literal}"{ts escape='js'}First{/ts}"{literal}, | |
112 | "sPrevious": {/literal}"{ts escape='js'}Previous{/ts}"{literal}, | |
113 | "sNext": {/literal}"{ts escape='js'}Next{/ts}"{literal}, | |
114 | "sLast": {/literal}"{ts escape='js'}Last{/ts}"{literal} | |
115 | } | |
116 | }, | |
117 | "fnServerData": function ( sSource, aoData, fnCallback ) { | |
118 | if (filterSearch) { | |
119 | aoData.push( | |
120 | {name:'title', value: cj('.crm-batch-search-form-block #title').val()} | |
121 | ); | |
122 | } | |
123 | cj.ajax({ | |
124 | "dataType": 'json', | |
125 | "type": "POST", | |
126 | "url": sSource, | |
127 | "data": aoData, | |
128 | "success": fnCallback | |
129 | }); | |
130 | } | |
131 | }); | |
132 | } | |
133 | ||
134 | </script> | |
135 | {/literal} |