From c370533bcd65b057e07a84270987ae6cd5e99a2a Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 6 Mar 2024 17:59:10 +0000 Subject: [PATCH] Bug 36215: Remove limit on fetching bookings This removes the paging from the bookings request so we take into account all bookings. We may want to replace this with date bounded paging in the future, but lets not try to optimise until we need to. To test: 1 - Find a record detail page in Koha staff interface 2 - Click on a barcode to go to items tab 3 - Edit 'bookable' to 'yes' 4 - Return to details page 5 - Place 5 bookings on a record 6 - Set system preference RESTDefaultPageSize 2 7 - Click the 'Bookings' tab on the record details 8 - Confirm onyl 2 bookings shown in calendar view 9 - Apply patch, reload 10 - All bookings now show in calendar Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi --- koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt | 2 +- koha-tmpl/intranet-tmpl/prog/js/place_booking_modal.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt index a8f51d3e197..83518866900 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/bookings/list.tt @@ -81,7 +81,7 @@ type: 'GET' }); var bookings = $.ajax({ - url: '/api/v1/biblios/[% biblionumber | uri %]/bookings', + url: '/api/v1/biblios/[% biblionumber | uri %]/bookings?_per_page=-1', headers: { 'x-koha-embed': 'patron' }, dataType: 'json', type: 'GET', diff --git a/koha-tmpl/intranet-tmpl/prog/js/place_booking_modal.js b/koha-tmpl/intranet-tmpl/prog/js/place_booking_modal.js index 946be01e3cd..7118c88afdb 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/place_booking_modal.js +++ b/koha-tmpl/intranet-tmpl/prog/js/place_booking_modal.js @@ -117,14 +117,14 @@ $('#placeBookingModal').on('show.bs.modal', function(e) { // Fetch list of bookable items let itemsFetch = $.ajax({ - url: '/api/v1/biblios/' + biblionumber + '/items?bookable=1' + '&_per_page=-1', + url: '/api/v1/biblios/' + biblionumber + '/items?bookable=1' + '?_per_page=-1', dataType: 'json', type: 'GET' }); // Fetch list of existing bookings let bookingsFetch = $.ajax({ - url: '/api/v1/bookings?biblio_id=' + biblionumber, + url: '/api/v1/bookings?biblio_id=' + biblionumber + '&_per_page=-1', dataType: 'json', type: 'GET' }); -- 2.44.0