Bugzilla – Attachment 169687 Details for
Bug 37363
Booking dates should respect closed days
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37363: Initial work on supporting closed days
Bug-37363-Initial-work-on-supporting-closed-days.patch (text/plain), 3.08 KB, created by
Martin Renvoize (ashimema)
on 2024-07-26 08:19:19 UTC
(
hide
)
Description:
Bug 37363: Initial work on supporting closed days
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-07-26 08:19:19 UTC
Size:
3.08 KB
patch
obsolete
>From e58ffa85ec5255869a88696c31284494d9f6fdac Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Fri, 26 Jul 2024 09:13:02 +0100 >Subject: [PATCH] Bug 37363: Initial work on supporting closed days > >This is just a proof of concept at this point.. we need api's for >fetching regular and irregular closed days before we can fully impliment >the functionality. >--- > .../prog/css/src/staff-global.scss | 6 ++++++ > .../prog/js/modals/place_booking.js | 17 ++++++++++++++--- > 2 files changed, 20 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >index 22d52bc7057..58ae4f025f7 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >+++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >@@ -883,6 +883,12 @@ $dayTrailBackground: #fcdcb3 !default; > background: #f5f5f5 !important; /* Light background */ > cursor: not-allowed !important; > } >+ >+ &.closed-day { >+ color: #aaa !important; >+ background: #FFFF99 !important; >+ cursor: not-allowed !important; >+ } > } > > .input-warning { >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 a298f441844..4268d3c6969 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js >@@ -784,15 +784,26 @@ $("#placeBookingModal").on("show.bs.modal", function (e) { > instance, > dayElem > ) { >- const currentDate = dayElem.dateObj >+ const currentDate = dayElem.dateObj; >+ const dateString = currentDate > .toISOString() > .split("T")[0]; > >- if (bookingsByDate[currentDate]) { >+ // Make closed days unclickable (while keeping them part of the range) >+ if (currentDate.getDay() === 0 || currentDate.getDay() === 6) { >+ dayElem.classList.add("closed-day"); >+ >+ // Remove the click event to disable the day >+ dayElem.addEventListener('click', function(event) { >+ event.stopImmediatePropagation(); >+ }, true); >+ } >+ >+ if (bookingsByDate[dateString]) { > const dots = document.createElement("span"); > dots.className = "event-dots"; > dayElem.appendChild(dots); >- bookingsByDate[currentDate].forEach(item => { >+ bookingsByDate[dateString].forEach(item => { > const dot = document.createElement("span"); > dot.className = "event item_" + item; > dots.appendChild(dot); >-- >2.45.2
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 37363
: 169687