From 9ec9fc3d78143e99313291f1cd31b554aeec20d6 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 Signed-off-by: Katrin Fischer (cherry picked from commit 1201a739676d37f805e886a6ac70c16b37eede14) Signed-off-by: Fridolin Somers --- 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 a8f51d3e19..8351886690 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 b4f13bf2d9..55055463da 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.39.5