|
Lines 4-9
Link Here
|
| 4 |
[% USE Koha %] |
4 |
[% USE Koha %] |
| 5 |
[% USE KohaDates %] |
5 |
[% USE KohaDates %] |
| 6 |
[% USE TablesSettings %] |
6 |
[% USE TablesSettings %] |
|
|
7 |
[% USE To %] |
| 7 |
[% PROCESS 'i18n.inc' %] |
8 |
[% PROCESS 'i18n.inc' %] |
| 8 |
[% SET footerjs = 1 %] |
9 |
[% SET footerjs = 1 %] |
| 9 |
[% INCLUDE 'doc-head-open.inc' %] |
10 |
[% INCLUDE 'doc-head-open.inc' %] |
|
Lines 57-64
Link Here
|
| 57 |
<h4>Refine results</h4> |
58 |
<h4>Refine results</h4> |
| 58 |
<ol> |
59 |
<ol> |
| 59 |
<li> |
60 |
<li> |
| 60 |
<label for="library">Holding library:</label> |
61 |
<label for="holding_library">Holding library:</label> |
| 61 |
<select name="library" id="library"> |
62 |
<select name="holding_library" id="holding_library"> |
|
|
63 |
[% SET libraries = Branches.all( only_from_group => 1 ) %] |
| 64 |
[% IF libraries.size != 1 %] |
| 65 |
<option value="">Any</option> |
| 66 |
[% END %] |
| 67 |
[% FOREACH l IN libraries %] |
| 68 |
[% IF (l.branchcode == branchcode) %] |
| 69 |
<option value="[% l.branchcode | html %]" selected="selected">[% l.branchname | html %]</option> |
| 70 |
[% ELSE %] |
| 71 |
<option value="[% l.branchcode | html %]">[% l.branchname | html %]</option> |
| 72 |
[% END %] |
| 73 |
[% END %] |
| 74 |
</select> |
| 75 |
</li> |
| 76 |
<li> |
| 77 |
<label for="pickup_library">Pickup library:</label> |
| 78 |
<select name="pickup_library" id="pickup_library"> |
| 62 |
[% SET libraries = Branches.all( only_from_group => 1 ) %] |
79 |
[% SET libraries = Branches.all( only_from_group => 1 ) %] |
| 63 |
[% IF libraries.size != 1 %] |
80 |
[% IF libraries.size != 1 %] |
| 64 |
<option value="">Any</option> |
81 |
<option value="">Any</option> |
|
Lines 130-139
Link Here
|
| 130 |
} |
147 |
} |
| 131 |
}, |
148 |
}, |
| 132 |
'item.holding_library_id': function() { |
149 |
'item.holding_library_id': function() { |
| 133 |
let library = $("#library").find(":selected").val(); |
150 |
let library = $("#holding_library").find(":selected").val(); |
| 134 |
return library; |
151 |
return library; |
| 135 |
}, |
152 |
}, |
| 136 |
status: { '!=': 'waiting' }, |
153 |
'pickup_library_id': function() { |
|
|
154 |
let library = $("#pickup_library").find(":selected").val(); |
| 155 |
return library; |
| 156 |
} |
| 157 |
}; |
| 158 |
|
| 159 |
[% SET libraries = Branches.all %] |
| 160 |
let all_libraries = [% To.json(libraries) | $raw %].map(e => { |
| 161 |
e['_id'] = e.branchcode; |
| 162 |
e['_str'] = e.branchname; |
| 163 |
return e; |
| 164 |
}); |
| 165 |
let filters_options = { |
| 166 |
[1] : () => all_libraries, |
| 137 |
}; |
167 |
}; |
| 138 |
|
168 |
|
| 139 |
var bookings_table_url = '/api/v1/bookings?'; |
169 |
var bookings_table_url = '/api/v1/bookings?'; |
|
Lines 155-161
Link Here
|
| 155 |
"visible": false |
185 |
"visible": false |
| 156 |
}, |
186 |
}, |
| 157 |
{ |
187 |
{ |
| 158 |
"data": "pickup_library.name", |
188 |
"data": "pickup_library.name:me.pickup_library_id", |
| 159 |
"title": _("Pickup library"), |
189 |
"title": _("Pickup library"), |
| 160 |
"searchable": true, |
190 |
"searchable": true, |
| 161 |
"orderable": true, |
191 |
"orderable": true, |
|
Lines 237-253
Link Here
|
| 237 |
"render": function(data, type, row, meta) { |
267 |
"render": function(data, type, row, meta) { |
| 238 |
return $date(row.start_date) + ' - ' + $date(row.end_date); |
268 |
return $date(row.start_date) + ' - ' + $date(row.end_date); |
| 239 |
} |
269 |
} |
| 240 |
}, |
|
|
| 241 |
{ |
| 242 |
"name": "actions", |
| 243 |
"title": _("Actions"), |
| 244 |
"searchable": false, |
| 245 |
"orderable": false, |
| 246 |
"render": function(data,type,row,meta){ |
| 247 |
return ""; |
| 248 |
} |
| 249 |
}] |
270 |
}] |
| 250 |
}, table_settings, 1, additional_filters); |
271 |
}, table_settings, 1, additional_filters, filters_options); |
| 251 |
|
272 |
|
| 252 |
/** Date filtering */ |
273 |
/** Date filtering */ |
| 253 |
$("#bookingsf").on("submit", function(e){ |
274 |
$("#bookingsf").on("submit", function(e){ |
| 254 |
- |
|
|