|
Lines 41-47
Link Here
|
| 41 |
<h1>Bookings for [% INCLUDE 'biblio-title-head.inc' %]</h1> |
41 |
<h1>Bookings for [% INCLUDE 'biblio-title-head.inc' %]</h1> |
| 42 |
<div class="page-section" id="bookings-timeline"></div> |
42 |
<div class="page-section" id="bookings-timeline"></div> |
| 43 |
<div class="page-section"> |
43 |
<div class="page-section"> |
| 44 |
[% INCLUDE 'additional-filters.inc' filters = [ { id = 'filter-expired', label_show = t('Include expired'), label_hide = t('Exclude expired') }, { id = 'filter-cancelled', label_show = t('Include cancelled'), label_hide = t('Exclude cancelled') }, ] filter_class = 'bookings' %] |
44 |
[% INCLUDE 'additional-filters.inc' filters = [ { id = 'filter-expired', label_show = t('Include expired'), label_hide = t('Exclude expired') }, { id = 'filter-cancelled', label_show = t('Include cancelled'), label_hide = t('Exclude cancelled') }, { id = 'filter-completed', label_show = t('Include completed'), label_hide = t('Exclude completed') },] filter_class = 'bookings' %] |
| 45 |
<table id="bookings_table"></table> |
45 |
<table id="bookings_table"></table> |
| 46 |
</div> |
46 |
</div> |
| 47 |
</div> |
47 |
</div> |
|
Lines 117-123
Link Here
|
| 117 |
content: !isActive ? `<s>${patronContent}</s>` : patronContent, |
117 |
content: !isActive ? `<s>${patronContent}</s>` : patronContent, |
| 118 |
className: booking.status === "cancelled" ? "cancelled" : "", |
118 |
className: booking.status === "cancelled" ? "cancelled" : "", |
| 119 |
[% IF CAN_user_circulate_manage_bookings %] |
119 |
[% IF CAN_user_circulate_manage_bookings %] |
| 120 |
editable: booking.status !== "cancelled" ? { remove: true, updateTime: true } : false, |
120 |
editable: !["cancelled", "completed"].includes(booking.status) ? { remove: true, updateTime: true } : false, |
| 121 |
[% ELSE %] |
121 |
[% ELSE %] |
| 122 |
editable: false, |
122 |
editable: false, |
| 123 |
[% END %] |
123 |
[% END %] |
|
Lines 202-208
Link Here
|
| 202 |
} |
202 |
} |
| 203 |
); |
203 |
); |
| 204 |
|
204 |
|
| 205 |
const additional_filters = AdditionalFilters.init(["filter-expired", "filter-cancelled"]) |
205 |
const additional_filters = AdditionalFilters.init(["filter-expired", "filter-cancelled", "filter-completed"]) |
| 206 |
.onChange((filters, { anyFiltersNotApplied }) => { |
206 |
.onChange((filters, { anyFiltersNotApplied }) => { |
| 207 |
bookings_table.DataTable().ajax.reload(); |
207 |
bookings_table.DataTable().ajax.reload(); |
| 208 |
}) |
208 |
}) |
|
Lines 219-224
Link Here
|
| 219 |
if (isNotApplied(filters['filter-cancelled'])) { |
219 |
if (isNotApplied(filters['filter-cancelled'])) { |
| 220 |
filtered.push("cancelled"); |
220 |
filtered.push("cancelled"); |
| 221 |
} |
221 |
} |
|
|
222 |
if (isNotApplied(filters['filter-completed'])) { |
| 223 |
filtered.push("completed"); |
| 224 |
} |
| 222 |
return { "-in": filtered }; |
225 |
return { "-in": filtered }; |
| 223 |
} |
226 |
} |
| 224 |
}); |
227 |
}); |
|
Lines 360-366
Link Here
|
| 360 |
"orderable": false, |
363 |
"orderable": false, |
| 361 |
"render": function(data, type, row, meta) { |
364 |
"render": function(data, type, row, meta) { |
| 362 |
let result = ""; |
365 |
let result = ""; |
| 363 |
const is_readonly = row.status === "cancelled"; |
366 |
const is_readonly = ["cancelled", "completed"].includes(row.status); |
| 364 |
[% IF CAN_user_circulate_manage_bookings %] |
367 |
[% IF CAN_user_circulate_manage_bookings %] |
| 365 |
if (!is_readonly) { |
368 |
if (!is_readonly) { |
| 366 |
result += ` |
369 |
result += ` |
|
Lines 408-416
Link Here
|
| 408 |
<input type="hidden" name="borrowernumber" value="%s"/> |
411 |
<input type="hidden" name="borrowernumber" value="%s"/> |
| 409 |
<input type="hidden" name="barcode" value="%s"/> |
412 |
<input type="hidden" name="barcode" value="%s"/> |
| 410 |
<input type="hidden" name="duedatespec" value="%s"/> |
413 |
<input type="hidden" name="duedatespec" value="%s"/> |
| 411 |
<input type="hidden" name="booking_id" value="%s"/> |
|
|
| 412 |
<button id="checkout_action" class="btn btn-default btn-xs" type="submit"> |
414 |
<button id="checkout_action" class="btn btn-default btn-xs" type="submit"> |
| 413 |
%s |
415 |
<i class="fa fa-check-circle" aria-hidden="true"></i> %s |
| 414 |
</button> |
416 |
</button> |
| 415 |
</form> |
417 |
</form> |
| 416 |
`.format( |
418 |
`.format( |
|
Lines 418-424
Link Here
|
| 418 |
escape_str(row.patron_id), |
420 |
escape_str(row.patron_id), |
| 419 |
escape_str(row.item.external_id), |
421 |
escape_str(row.item.external_id), |
| 420 |
escape_str(row.end_date), |
422 |
escape_str(row.end_date), |
| 421 |
escape_str(row.booking_id), |
|
|
| 422 |
_("Transform to checkout") |
423 |
_("Transform to checkout") |
| 423 |
); |
424 |
); |
| 424 |
} |
425 |
} |
| 425 |
- |
|
|