Bug 36373

Summary: Show existing bookings in datepicker
Product: Koha Reporter: Martin Renvoize <martin.renvoize>
Component: Staff interfaceAssignee: Martin Renvoize <martin.renvoize>
Status: Pushed to main --- QA Contact: Kyle M Hall <kyle>
Severity: enhancement    
Priority: P5 - low CC: esther.melander, gmcharlt, kkrueger, kyle, nick, oleonard
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00
Bug Depends on: 36374    
Bug Blocks:    
Attachments: Bug 36373: Show existing bookings in the datepicker
Bug 36373: Show existing bookings in the datepicker
Bug 36373: Show existing bookings in the datepicker

Description Martin Renvoize 2024-03-20 15:03:49 UTC
We should, fairly trivially, be able to display existing bookings on the bookings datepicker.  This would make it a little simpler for staff to pick an item for the user at booking time.
Comment 1 Martin Renvoize 2024-03-20 17:10:32 UTC
Created attachment 163572 [details] [review]
Bug 36373: Show existing bookings in the datepicker

This patch exposes existing bookings as info dots in the flatpickr
Comment 2 Martin Renvoize 2024-03-20 17:11:48 UTC
Just a quick proof of concept here...  Nice to have, but could have performance implications and would need some tidying up before it's ready for prime time (like, I'd like different items in different colors and the dots to have a hover function that would yield item detail)
Comment 3 Kristi 2024-03-25 17:00:04 UTC
Is this still in progress, or is it ready for a sign off attempt?
Comment 4 Esther Melander 2024-03-26 18:18:29 UTC
My test plan:

1. Search the catalog and find an item and make it bookable
2. Place a booking on that item (select the same barcode) for three different patrons.

See the available booking dates change with each additional booking for the same item.

Repeat this, but

1. Select a bibliographic record with multiple items. Make each item bookable.
2. Place a booking, but select the option for "any item" for three different patrons. Have one of the bookings overlap another.

See the available booking dates change with each additional booking. The dates with a dot indicate a copy  has been booked. A date with more than one dot indicates more than one copy has been booked.

Look at the bookings tab for the bibliographic record. See the different bookings with the patrons names and dates and the assigned item.
Comment 5 ByWater Sandboxes 2024-03-26 18:19:29 UTC
Created attachment 163954 [details] [review]
Bug 36373: Show existing bookings in the datepicker

This patch exposes existing bookings as info dots in the flatpickr

Signed-off-by: Esther <esther@bywatersolutions.com>
Comment 6 Esther Melander 2024-03-26 18:22:05 UTC
This seems to work fine. It would be nice to have a hover function for the dots. Some libraries have many copies, such as for a book club, and the dots may not work as well - may cause a very cluttered date picker. I did not test the limits, but something to consider. For now, it works as intended.
Comment 7 Martin Renvoize 2024-03-26 19:33:10 UTC
Haha, that's great. This was really just a bit of a proof of concept I pulled out of the lead-in/trail-out work I've been doing for one of the other bookings bugs. I decided I was going down a wrong path there but liked this piece enough to pull it out for safe keeping here.

Thanks for writing a test plan and the feedback Esther.  You've identified most of the points I was worried about as it happens.  It won't scale well as it is UI wise but I haven't come up with an alternative as yet so I'm open to suggestions.  I was contemplating different colours for different items, dots Vs lines, hints in hover or numeric labels for numbers if items booked per day.

All good for thought, I'll continue here once I've got the tie other bookings bugs I have in progress submitted as they have a more pressing deadline at the minute.

Thanks again,
Comment 8 Kyle M Hall 2024-05-10 15:48:26 UTC
Created attachment 166585 [details] [review]
Bug 36373: Show existing bookings in the datepicker

This patch exposes existing bookings as info dots in the flatpickr

Signed-off-by: Esther <esther@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 9 Katrin Fischer 2024-05-13 10:03:53 UTC
The . is a bit subtle, I think a tooltip on hover would be nice, right now you just get the "forbidden" sign.
Comment 10 Katrin Fischer 2024-05-13 12:02:30 UTC
Pushed for 24.05!

Well done everyone, thank you!