Line 0
Link Here
|
0 |
- |
1 |
[% USE raw %] |
|
|
2 |
[% USE Asset %] |
3 |
[% USE Koha %] |
4 |
[% USE KohaDates %] |
5 |
[% USE TablesSettings %] |
6 |
[% PROCESS 'i18n.inc' %] |
7 |
[% SET footerjs = 1 %] |
8 |
[% INCLUDE 'doc-head-open.inc' %] |
9 |
<title>[% FILTER collapse %] |
10 |
[% t("Bookings to collect") | html %] › |
11 |
[% t("Circulation") | html %] › |
12 |
[% t("Koha") | html %] |
13 |
[% END %]</title> |
14 |
[% INCLUDE 'doc-head-close.inc' %] |
15 |
</head> |
16 |
|
17 |
<body id="circ_pendingbookings" class="circ"> |
18 |
[% INCLUDE 'header.inc' %] |
19 |
[% INCLUDE 'circ-search.inc' %] |
20 |
|
21 |
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb"> |
22 |
<ol> |
23 |
<li> |
24 |
<a href="/cgi-bin/koha/mainpage.pl">Home</a> |
25 |
</li> |
26 |
<li> |
27 |
<a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> |
28 |
</li> |
29 |
<li> |
30 |
<a href="#" aria-current="page"> |
31 |
Bookings to collect |
32 |
</a> |
33 |
</li> |
34 |
</ol> |
35 |
</nav> |
36 |
|
37 |
<div class="main container-fluid"> |
38 |
<div class="row"> |
39 |
|
40 |
<!-- Results --> |
41 |
<div class="col-sm-10 col-sm-push-2"> |
42 |
<main> |
43 |
<h2>Items required for bookings between <span id="from_date">[% from | $KohaDates %]</span> and <span id="to_date">[% to | $KohaDates %]</span></h2> |
44 |
<h3>Reported on [% todaysdate | $KohaDates %]</h3> |
45 |
<p>The following items have not been collected for bookings. Please retrieve them |
46 |
and check them in.</p> |
47 |
<div id="searchresults"> |
48 |
<table id="bookingst"></table> |
49 |
</div> |
50 |
</main> |
51 |
</div> |
52 |
|
53 |
<!-- Filters --> |
54 |
<div class="col-sm-2 col-sm-pull-10"> |
55 |
<aside> |
56 |
<div id="filters"> |
57 |
<form id="bookingsf"> |
58 |
<fieldset class="brief"> |
59 |
<h4>Refine results</h4> |
60 |
<ol> |
61 |
<li> |
62 |
<label for="from">Start date: </label> |
63 |
<input type="text" size="10" id="from" name="from" value="[% from | html %]" class="flatpickr" data-date_to="to"/> |
64 |
</li> |
65 |
<li> |
66 |
<label for="to">End date: </label> |
67 |
<input type="text" size="10" id="to" name="to" value="[% to | html %]" class="flatpickr"/> |
68 |
</li> |
69 |
</ol> |
70 |
|
71 |
<fieldset class="action"> |
72 |
<input type="submit" name="run_report" value="Submit" class="submit"/> |
73 |
</fieldset> |
74 |
</fieldset> |
75 |
</form> |
76 |
</div> |
77 |
</aside> |
78 |
</div> |
79 |
</div> |
80 |
<!-- /.row --> |
81 |
|
82 |
[% MACRO jsinclude BLOCK %] |
83 |
[% INCLUDE 'calendar.inc' %] |
84 |
[% INCLUDE 'datatables.inc' %] |
85 |
[% INCLUDE 'columns_settings.inc' %] |
86 |
[% Asset.js("lib/jquery/plugins/jquery.dataTables.columnFilter.js") | $raw %] |
87 |
[% INCLUDE 'js-biblio-format.inc' %] |
88 |
[% INCLUDE 'js-date-format.inc' %] |
89 |
[% INCLUDE 'js-patron-format.inc' %] |
90 |
<script> |
91 |
let table_settings = [% TablesSettings.GetTableSettings( 'circ', 'bookings', 'bookings-to-collect', 'json' ) | $raw %]; |
92 |
$(document).ready(function() { |
93 |
|
94 |
let additional_filters = { |
95 |
start_date: function() { |
96 |
let fromdate = $("#from"); |
97 |
let isoFrom; |
98 |
if ( fromdate.val() !== '' ) { |
99 |
isoFrom = fromdate.get(0)._flatpickr.selectedDates[0].toISOString().substring(0,10); |
100 |
} |
101 |
|
102 |
let todate = $("#to"); |
103 |
let isoTo; |
104 |
if ( todate.val() !== '' ) { |
105 |
isoTo = todate.get(0)._flatpickr.selectedDates[0].toISOString().substring(0,10); |
106 |
} |
107 |
|
108 |
return { '>=': isoFrom, '<=': isoTo }; |
109 |
} |
110 |
}; |
111 |
|
112 |
var bookings_table_url = '/api/v1/bookings?'; |
113 |
var bookings_table = $("#bookingst").kohaTable({ |
114 |
"ajax": { |
115 |
"url": bookings_table_url |
116 |
}, |
117 |
"embed": [ |
118 |
"biblio", |
119 |
"item", |
120 |
"patron" |
121 |
], |
122 |
"order": [[ 1, "asc" ]], |
123 |
"columns": [{ |
124 |
"data": "booking_id", |
125 |
"title": "Booking ID", |
126 |
"visible": false |
127 |
}, |
128 |
{ |
129 |
"data": "biblio.title", |
130 |
"title": "Title", |
131 |
"searchable": true, |
132 |
"orderable": true, |
133 |
"render": function(data,type,row,meta) { |
134 |
return $biblio_to_html(row.biblio, { |
135 |
link: 'bookings' |
136 |
}); |
137 |
} |
138 |
}, |
139 |
{ |
140 |
"data": "item.external_id", |
141 |
"title": "Item", |
142 |
"searchable": true, |
143 |
"orderable": true, |
144 |
"defaultContent": "Any item", |
145 |
"render": function(data,type,row,meta) { |
146 |
if ( row.item ) { |
147 |
return row.item.external_id + " (" + row.booking_id + ")"; |
148 |
} else { |
149 |
return null; |
150 |
} |
151 |
} |
152 |
}, |
153 |
{ |
154 |
"data": "item.callnumber", |
155 |
"title": "Callnumber", |
156 |
"searchable": true, |
157 |
"orderable": true, |
158 |
"render": function(data,type,row,meta) { |
159 |
if ( row.item ) { |
160 |
return row.item.callnumber; |
161 |
} else { |
162 |
return null; |
163 |
} |
164 |
} |
165 |
}, |
166 |
{ |
167 |
"data": "patron.firstname:patron.surname", |
168 |
"title": "Patron", |
169 |
"searchable": true, |
170 |
"orderable": true, |
171 |
"render": function(data, type, row, meta) { |
172 |
return $patron_to_html(row.patron, { |
173 |
display_cardnumber: true, |
174 |
url: true |
175 |
}); |
176 |
} |
177 |
}, |
178 |
{ |
179 |
"data": "start_date", |
180 |
"name": "start_date", |
181 |
"title": "Booking dates", |
182 |
"type": "date", |
183 |
"searchable": false, |
184 |
"orderable": true, |
185 |
"render": function(data, type, row, meta) { |
186 |
return $date(row.start_date) + ' - ' + $date(row.end_date); |
187 |
} |
188 |
}, |
189 |
{ |
190 |
"name": "actions", |
191 |
"title": "Actions", |
192 |
"searchable": false, |
193 |
"orderable": false, |
194 |
"render": function(data,type,row,meta){ |
195 |
return ""; |
196 |
} |
197 |
}] |
198 |
}, table_settings, 1, additional_filters); |
199 |
|
200 |
/** Date filtering */ |
201 |
$("#bookingsf").on("submit", function(e){ |
202 |
/* stop form from submitting normally */ |
203 |
e.preventDefault(); |
204 |
bookings_table.DataTable().draw(); |
205 |
}); |
206 |
}); |
207 |
</script> |
208 |
[% END %] |
209 |
[% INCLUDE 'intranet-bottom.inc' %] |