Bugzilla – Attachment 191767 Details for
Bug 39584
Booking post-processing time cuts into circulation period
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39584: Fix end date disable to check selected item, not all items
a66c167.patch (text/plain), 3.48 KB, created by
Martin Renvoize (ashimema)
on 2026-01-21 10:56:58 UTC
(
hide
)
Description:
Bug 39584: Fix end date disable to check selected item, not all items
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2026-01-21 10:56:58 UTC
Size:
3.48 KB
patch
obsolete
>From a66c167f452a16f780c4a70ee9b806864f969b34 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@openfifth.co.uk> >Date: Wed, 21 Jan 2026 09:28:21 +0000 >Subject: [PATCH] Bug 39584: Fix end date disable to check selected item, not > all items > >When a specific item is selected in the booking modal, the end date >disable logic was incorrectly checking if ALL bookable items were >unavailable before disabling a date. This meant dates with existing >bookings for the selected item remained selectable if other items >were available. > >Now when a specific item is selected (booking_item_id != 0), the >logic checks if that specific item is in the unavailable_items list. >The "all items unavailable" check is only used when "Any item" is >selected. > >This aligns the end date selection behavior with the start date >selection behavior, which already correctly checks only the selected >item. > >Signed-off-by: Kristi Krueger <kkrueger@cuyahogalibrary.org> >--- > .../prog/js/modals/place_booking.js | 30 ++++++++++++++----- > 1 file changed, 22 insertions(+), 8 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js b/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js >index a97348b6bbd..5b7bb772c31 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js >@@ -566,14 +566,28 @@ $("#placeBookingModal").on("show.bs.modal", function (e) { > continue; > } > >- // check that there are available items >- // available = all bookable items - booked items - booked biblios >- let total_available = >- bookable_items.length - >- unavailable_items.length - >- biblio_bookings.length; >- if (total_available === 0) { >- return true; >+ // check availability based on selection type >+ if ( >+ booking_item_id && >+ booking_item_id != 0 >+ ) { >+ // Specific item selected - check if that item is unavailable >+ if ( >+ unavailable_items.indexOf( >+ parseInt(booking_item_id) >+ ) !== -1 >+ ) { >+ return true; >+ } >+ } else { >+ // "Any item" selected - check if all items are unavailable >+ let total_available = >+ bookable_items.length - >+ unavailable_items.length - >+ biblio_bookings.length; >+ if (total_available === 0) { >+ return true; >+ } > } > } > >-- >2.52.0 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 39584
:
181312
|
181394
|
182448
|
182451
|
182678
|
182679
|
182680
|
182910
|
190822
|
190823
|
190824
|
190825
|
190898
|
190931
|
190932
|
190933
|
191765
|
191766
|
191767
|
191768
|
191855
|
191856
|
191857
|
191941
|
191942
|
191943