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 <nick@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit 1201a73967)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
Nick Clemens 2024-03-06 17:59:10 +00:00 committed by Fridolin Somers
parent fdd7731a46
commit 9ec9fc3d78
2 changed files with 3 additions and 3 deletions

View File

@ -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',

View File

@ -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'
});