Bugzilla – Attachment 169579 Details for
Bug 34440
Add warm-up and cool-down periods to bookings
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34440: (follow-up) Enable flatpickr only once rules are populated
Bug-34440-follow-up-Enable-flatpickr-only-once-rul.patch (text/plain), 3.24 KB, created by
Martin Renvoize (ashimema)
on 2024-07-25 15:44:17 UTC
(
hide
)
Description:
Bug 34440: (follow-up) Enable flatpickr only once rules are populated
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-07-25 15:44:17 UTC
Size:
3.24 KB
patch
obsolete
>From bba2aed2d1e927c6ac9d86e57edfcdf547575649 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 15 Jul 2024 14:42:26 +0100 >Subject: [PATCH] Bug 34440: (follow-up) Enable flatpickr only once rules are > populated > >--- > .../prog/js/modals/place_booking.js | 24 +++++++++++-------- > 1 file changed, 14 insertions(+), 10 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 323009d5905..bbb19aa899d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js >+++ b/koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js >@@ -133,7 +133,7 @@ $("#placeBookingModal").on("show.bs.modal", function (e) { > // Lead and Trail days syncing > let leadDays = 0; > let trailDays = 0; >- function setBufferDays() { >+ function getCirculationRules() { > let rules_url = "/api/v1/circulation_rules"; > $.ajax({ > url: rules_url, >@@ -149,6 +149,14 @@ $("#placeBookingModal").on("show.bs.modal", function (e) { > let rules = response[0] > leadDays = rules.bookings_lead_period; > trailDays = rules.bookings_trail_period; >+ >+ // redraw pariodPicker taking selected item into account >+ periodPicker.redraw(); >+ >+ // Enable flatpickr now we have data we need >+ if (dataFetched) { >+ $("#period_fields :input").prop("disabled", false); >+ } > }, > error: function (xhr, status, error) { > console.log("Circulation rules fetch failed: ", error); >@@ -274,7 +282,7 @@ $("#placeBookingModal").on("show.bs.modal", function (e) { > } > > // Populate circulation rules >- setBufferDays(); >+ getCirculationRules(); > }); > > // Adopt periodPicker >@@ -578,8 +586,8 @@ $("#placeBookingModal").on("show.bs.modal", function (e) { > }); > $("#booking_item_id").trigger("change.select2"); > >- // update buffer days >- setBufferDays(); >+ // Update circulation rules >+ getCirculationRules(); > }); > > // Setup listener for item select2 >@@ -625,11 +633,8 @@ $("#placeBookingModal").on("show.bs.modal", function (e) { > $("#booking_itemtype").prop("disabled", false); > } > >- // update buffer days >- setBufferDays(); >- >- // redraw pariodPicker taking selected item into account >- periodPicker.redraw(); >+ // Update circulation rules >+ getCirculationRules(); > }); > > // Setup listener for pickup location select2 >@@ -859,7 +864,6 @@ $("#placeBookingModal").on("show.bs.modal", function (e) { > > // Enable flatpickr now we have date function populated > periodPicker.redraw(); >- $("#period_fields :input").prop("disabled", false); > > // Redraw itemtype select with new options and enable > let $bookingItemtypeSelect = $("#booking_itemtype"); >-- >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 34440
:
167948
|
167949
|
167950
|
167951
|
167952
|
167953
|
167954
|
167955
|
168941
|
168942
|
168943
|
168944
|
168945
|
168946
|
168947
|
168948
|
168949
|
168998
|
168999
|
169000
|
169001
|
169002
|
169003
|
169004
|
169005
|
169006
|
169007
|
169571
|
169572
|
169573
|
169574
|
169575
|
169576
|
169577
|
169578
|
169579
|
169580
|
169581
|
169587
|
169588
|
170032
|
170033
|
170034
|
170035
|
170036
|
170037
|
170038
|
170039
|
170040
|
170041
|
170042
|
170046
|
170047
|
170048
|
170049
|
170050
|
170051
|
170052
|
170053
|
170054
|
170055
|
170056
|
170589
|
170590
|
170591
|
170592
|
170593
|
170594
|
170595
|
170596
|
170597
|
170598
|
170599
|
170600
|
170603
|
170610
|
170951