Lines 1-9
Link Here
|
1 |
[% USE raw %] |
1 |
[% USE raw %] |
2 |
[% USE Asset %] |
2 |
[% USE Asset %] |
|
|
3 |
[% USE Branches %] |
3 |
[% SET footerjs = 1 %] |
4 |
[% SET footerjs = 1 %] |
4 |
[% USE ColumnsSettings %] |
|
|
5 |
[% INCLUDE 'doc-head-open.inc' %] |
5 |
[% INCLUDE 'doc-head-open.inc' %] |
6 |
<title>Koha › Administration › Cash Registers |
6 |
<title>Koha › Administration › Cash registers |
7 |
[% IF op == 'add_form' %] |
7 |
[% IF op == 'add_form' %] |
8 |
›[% IF cash_register %]Modify cash register[% ELSE %]New cash register [% cash_register.id | html %][% END %] |
8 |
›[% IF cash_register %]Modify cash register[% ELSE %]New cash register [% cash_register.id | html %][% END %] |
9 |
[% ELSIF op == 'delete_confirm' %] |
9 |
[% ELSIF op == 'delete_confirm' %] |
Lines 36-55
Link Here
|
36 |
[% FOREACH m IN messages %] |
36 |
[% FOREACH m IN messages %] |
37 |
<div class="dialog [% m.type | html %]"> |
37 |
<div class="dialog [% m.type | html %]"> |
38 |
[% SWITCH m.code %] |
38 |
[% SWITCH m.code %] |
39 |
[% CASE 'error_on_update' %] |
39 |
[% CASE 'success_on_insert' %] |
40 |
An error occurred when updating this cash register. |
40 |
Cash register added successfully. |
41 |
[% CASE 'error_on_insert' %] |
41 |
[% CASE 'error_on_insert' %] |
42 |
An error occurred when adding this cash register. |
42 |
An error occurred when adding this cash register. |
43 |
[% CASE 'success_on_update' %] |
43 |
[% CASE 'success_on_update' %] |
44 |
Cash register updated successfully. |
44 |
Cash register updated successfully. |
45 |
[% CASE 'success_on_insert' %] |
45 |
[% CASE 'error_on_update' %] |
46 |
Cash register added successfully. |
46 |
An error occurred when updating this cash register. |
|
|
47 |
[% CASE 'success_on_default' %] |
48 |
Branch default updated successfully. |
49 |
[% CASE 'error_on_update' %] |
50 |
An error on setting branch default. |
47 |
[% CASE 'success_on_archive' %] |
51 |
[% CASE 'success_on_archive' %] |
48 |
Cash register archived successfully. |
52 |
Cash register archived successfully. |
49 |
[% CASE 'success_on_restore' %] |
53 |
[% CASE 'success_on_restore' %] |
50 |
Cash register restored successfully. |
54 |
Cash register restored successfully. |
51 |
[% CASE 'success_on_delete' %] |
|
|
52 |
Cash register deleted successfully. |
53 |
[% CASE %] |
55 |
[% CASE %] |
54 |
[% m.code | html %] |
56 |
[% m.code | html %] |
55 |
[% END %] |
57 |
[% END %] |
Lines 81-87
Link Here
|
81 |
<input type="text" name="description" id="description" value="[% cash_register.description %]"/> |
83 |
<input type="text" name="description" id="description" value="[% cash_register.description %]"/> |
82 |
</li> |
84 |
</li> |
83 |
<li> |
85 |
<li> |
84 |
<label for="branch">Branch: </label> |
86 |
<label for="branch">Library: </label> |
85 |
<select id="branch" name="branch"> |
87 |
<select id="branch" name="branch"> |
86 |
[% FOREACH branch IN branch_list %] |
88 |
[% FOREACH branch IN branch_list %] |
87 |
[% IF cash_register.branch == branch.branchcode %] |
89 |
[% IF cash_register.branch == branch.branchcode %] |
Lines 116-142
Link Here
|
116 |
<a class="btn btn-default" id="newcashregister" href="/cgi-bin/koha/admin/cash_registers.pl?op=add_form"><i class="fa fa-plus"></i> New cash register</a> |
118 |
<a class="btn btn-default" id="newcashregister" href="/cgi-bin/koha/admin/cash_registers.pl?op=add_form"><i class="fa fa-plus"></i> New cash register</a> |
117 |
</div> |
119 |
</div> |
118 |
|
120 |
|
119 |
<h3>Cash Registers</h3> |
121 |
<h3>Cash registers for <select id="branch_filter" name="branch_filter"> |
|
|
122 |
<option value=""></option> |
123 |
[% PROCESS options_for_libraries libraries => Branches.all( selected => branchcode, unfiltered => 1, ) %] |
124 |
</select> |
125 |
</h3> |
126 |
|
120 |
[% IF cash_registers.count %] |
127 |
[% IF cash_registers.count %] |
121 |
<table id="table_cash_registers"> |
128 |
<table id="table_cash_registers"> |
122 |
<thead> |
129 |
<thead> |
123 |
<th>Id</th> |
|
|
124 |
<th>Name</th> |
130 |
<th>Name</th> |
125 |
<th>Description</th> |
131 |
<th>Description</th> |
126 |
<th>Branch</th> |
132 |
<th>Library</th> |
|
|
133 |
<th>Default</th> |
127 |
<th>Initial float</th> |
134 |
<th>Initial float</th> |
128 |
<th>Actions</th> |
135 |
<th>Actions</th> |
129 |
</thead> |
136 |
</thead> |
130 |
<tbody> |
137 |
<tbody> |
131 |
[% FOREACH cash_register IN cash_registers %] |
138 |
[% FOREACH cash_register IN cash_registers %] |
|
|
139 |
[% IF cash_register.branch_default %] |
140 |
<tr class="default"> |
141 |
[% ELSE %] |
132 |
<tr> |
142 |
<tr> |
133 |
<td>[% cash_register.id %]</td> |
143 |
[% END %] |
134 |
<td>[% cash_register.name %]</td> |
144 |
<td>[% cash_register.name %]</td> |
135 |
<td>[% cash_register.description %]</td> |
145 |
<td>[% cash_register.description %]</td> |
136 |
<td>[% cash_register.library.branchname %]</td> |
146 |
<td>[% cash_register.library.branchname %]</td> |
|
|
147 |
<td>[% IF cash_register.branch_default %]Yes[% ELSE %]No[% END %]</td> |
137 |
<td>[% cash_register.starting_float %]</td> |
148 |
<td>[% cash_register.starting_float %]</td> |
138 |
[% IF cash_register.archived == '0' %] |
149 |
[% IF cash_register.archived == '0' %] |
139 |
<td class="actions"><a class="btn btn-default btn-xs" href="cash_registers.pl?op=add_form&id=[% cash_register.id | uri %]"><i class="fa fa-pencil"></i> Edit</a><a class="btn btn-default btn-xs" href="cash_registers.pl?op=archive&id=[% cash_register.id %]"><i class="fa fa-archive"></i> Archive</a></td> |
150 |
<td class="actions"> |
|
|
151 |
<a class="btn btn-default btn-xs" href="cash_registers.pl?op=add_form&id=[% cash_register.id | uri %]"><i class="fa fa-pencil"></i> Edit</a> |
152 |
[% IF cash_register.branch_default %] |
153 |
<a class="btn btn-default btn-xs" href="cash_registers.pl?op=drop_default&id=[% cash_register.id %]"><i class="fa fa-archive"></i> Drop default</a> |
154 |
[% ELSE %] |
155 |
<a class="btn btn-default btn-xs" href="cash_registers.pl?op=make_default&id=[% cash_register.id %]"><i class="fa fa-archive"></i> Make default</a> |
156 |
[% END %] |
157 |
<a class="btn btn-default btn-xs" href="cash_registers.pl?op=archive&id=[% cash_register.id %]"><i class="fa fa-archive"></i> Archive</a> |
158 |
</td> |
140 |
[% ELSE %] |
159 |
[% ELSE %] |
141 |
<td class="actions"><a class="btn btn-default btn-xs" href="cash_registers.pl?op=unarchive&id=[% cash_register.id %]"><i class="fa fa-trash-restore"></i> Restore</a></td> |
160 |
<td class="actions"><a class="btn btn-default btn-xs" href="cash_registers.pl?op=unarchive&id=[% cash_register.id %]"><i class="fa fa-trash-restore"></i> Restore</a></td> |
142 |
[% END %] |
161 |
[% END %] |
Lines 161-175
Link Here
|
161 |
[% MACRO jsinclude BLOCK %] |
180 |
[% MACRO jsinclude BLOCK %] |
162 |
[% Asset.js("js/admin-menu.js") | $raw %] |
181 |
[% Asset.js("js/admin-menu.js") | $raw %] |
163 |
[% INCLUDE 'datatables.inc' %] |
182 |
[% INCLUDE 'datatables.inc' %] |
164 |
|
|
|
165 |
<script> |
183 |
<script> |
|
|
184 |
function filterDataTable( table, column, term ){ |
185 |
if( column ){ |
186 |
table.column( column ).search( term ).draw(); |
187 |
} else { |
188 |
table.search( term ).draw(); |
189 |
} |
190 |
clearFilter( term ); |
191 |
} |
192 |
|
193 |
function clearFilter( term ){ |
194 |
if( term == "" ){ |
195 |
$(".dt_button_clear_filter").addClass("disabled"); |
196 |
} else { |
197 |
$(".dt_button_clear_filter").removeClass("disabled"); |
198 |
} |
199 |
} |
200 |
|
166 |
$(document).ready(function() { |
201 |
$(document).ready(function() { |
167 |
$("#table_cash_registers").dataTable($.extend(true, {}, dataTablesDefaults, { |
202 |
var crtable = $("#table_cash_registers").DataTable($.extend(true, {}, dataTablesDefaults, { |
168 |
"aoColumnDefs": [ |
203 |
"aoColumnDefs": [ |
169 |
{ "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable":false }, |
204 |
{ "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable":false }, |
170 |
], |
205 |
], |
171 |
"aaSorting": [[ 1, "asc" ]], |
206 |
"aaSorting": [[ 1, "asc" ]], |
|
|
207 |
"paginationType": "four_button", |
172 |
})); |
208 |
})); |
|
|
209 |
|
210 |
$("#branch_filter").on("change", function(){ |
211 |
// Table must be filtered by the <option>'s text, not its value |
212 |
var opt = $(this).find("option:selected").text(); |
213 |
filterDataTable( crtable, 2, opt ); |
214 |
}); |
215 |
|
173 |
}); |
216 |
}); |
174 |
</script> |
217 |
</script> |
175 |
[% END %] |
218 |
[% END %] |
176 |
- |
|
|