Description
Martin Renvoize (ashimema)
2024-07-14 06:02:17 UTC
Created attachment 168950 [details] [review] Bug 37354: Set maxDate based on issuelength + renewals * renewalperiod This patch sets the flatpickr maxDate in the bookings range picker to the startdate selected + issuelength + renewals * renewalperiod circulation rules. We'll likely want to also enforce this in the API controller level.. or perhaps at the koha object level. Created attachment 168964 [details] [review] Bug 37354: Set maxDate based on issuelength + renewals * renewalperiod This patch sets the flatpickr maxDate in the bookings range picker to the startdate selected + issuelength + renewals * renewalperiod circulation rules. Created attachment 168965 [details] [review] Bug 37354: Add visual hint at usual loan periods This patch adds a visual hint to the datepicker to highlight dates that line up with normal loan and renewal lengths. We use bold to highlight such dates. Created attachment 168966 [details] [review] Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod) This patch sets the flatpickr maxDate in the bookings range picker to the startdate selected + issuelength + renewals * renewalperiod circulation rules. Test plan 1) Set an item in a test biblio to 'bookable' from the items tab. 2) Note the itemtype of the above item 3) Add circulation rules for the above item type, in particular the 'Loan period', 'Renewals allowed' and 'Renewal period' options. 4) Go back to your biblio and 'Place booking'. Select a user, pickup location and item. 5) Open the booking dates flatpickr. 6) Select a start date. 7) Note that the date that is 'Loan period' + 'Renewals allowed' * 'Renewal period' is now greyed out and cannot be selected or any date beyond it either. Created attachment 168967 [details] [review] Bug 37354: Add visual hint at usual loan periods This patch adds a visual hint to the datepicker to highlight dates that line up with normal loan and renewal lengths. We use bold to highlight such dates. Test plan 1) Repeat the test plan for the previous patch 2) Note that once you have selected your first date, that date will become bold, the date a 'Loan period' after the start date will also be bold and you'll also have bold dates for the number of 'Renewals allowed' at each 'Renewal period' beyond the initial 'Loan period' date. Created attachment 169008 [details] [review] Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod) This patch sets the flatpickr maxDate in the bookings range picker to the startdate selected + issuelength + renewals * renewalperiod circulation rules. Test plan 1) Set an item in a test biblio to 'bookable' from the items tab. 2) Note the itemtype of the above item 3) Add circulation rules for the above item type, in particular the 'Loan period', 'Renewals allowed' and 'Renewal period' options. 4) Go back to your biblio and 'Place booking'. Select a user, pickup location and item. 5) Open the booking dates flatpickr. 6) Select a start date. 7) Note that the date that is 'Loan period' + 'Renewals allowed' * 'Renewal period' is now greyed out and cannot be selected or any date beyond it either. Created attachment 169009 [details] [review] Bug 37354: Add visual hint at usual loan periods This patch adds a visual hint to the datepicker to highlight dates that line up with normal loan and renewal lengths. We use bold to highlight such dates. Test plan 1) Repeat the test plan for the previous patch 2) Note that once you have selected your first date, that date will become bold, the date a 'Loan period' after the start date will also be bold and you'll also have bold dates for the number of 'Renewals allowed' at each 'Renewal period' beyond the initial 'Loan period' date. I would test it today but there is just a little conflict with a fresh main branch in koha-tmpl/intranet-tmpl/prog/js/modals/place_booking.js Created attachment 169590 [details] [review] Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod) This patch sets the flatpickr maxDate in the bookings range picker to the startdate selected + issuelength + renewals * renewalperiod circulation rules. Test plan 1) Set an item in a test biblio to 'bookable' from the items tab. 2) Note the itemtype of the above item 3) Add circulation rules for the above item type, in particular the 'Loan period', 'Renewals allowed' and 'Renewal period' options. 4) Go back to your biblio and 'Place booking'. Select a user, pickup location and item. 5) Open the booking dates flatpickr. 6) Select a start date. 7) Note that the date that is 'Loan period' + 'Renewals allowed' * 'Renewal period' is now greyed out and cannot be selected or any date beyond it either. Created attachment 169591 [details] [review] Bug 37354: Add visual hint at usual loan periods This patch adds a visual hint to the datepicker to highlight dates that line up with normal loan and renewal lengths. We use bold to highlight such dates. Test plan 1) Repeat the test plan for the previous patch 2) Note that once you have selected your first date, that date will become bold, the date a 'Loan period' after the start date will also be bold and you'll also have bold dates for the number of 'Renewals allowed' at each 'Renewal period' beyond the initial 'Loan period' date. Rebased and ready for testing again. Created attachment 169685 [details] [review] Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod) This patch sets the flatpickr maxDate in the bookings range picker to the startdate selected + issuelength + renewals * renewalperiod circulation rules. Test plan 1) Set an item in a test biblio to 'bookable' from the items tab. 2) Note the itemtype of the above item 3) Add circulation rules for the above item type, in particular the 'Loan period', 'Renewals allowed' and 'Renewal period' options. 4) Go back to your biblio and 'Place booking'. Select a user, pickup location and item. 5) Open the booking dates flatpickr. 6) Select a start date. 7) Note that the date that is 'Loan period' + 'Renewals allowed' * 'Renewal period' is now greyed out and cannot be selected or any date beyond it either. Created attachment 169686 [details] [review] Bug 37354: Add visual hint at usual loan periods This patch adds a visual hint to the datepicker to highlight dates that line up with normal loan and renewal lengths. We use bold to highlight such dates. Test plan 1) Repeat the test plan for the previous patch 2) Note that once you have selected your first date, that date will become bold, the date a 'Loan period' after the start date will also be bold and you'll also have bold dates for the number of 'Renewals allowed' at each 'Renewal period' beyond the initial 'Loan period' date. In testing I noticed that if you don't select an item and just leave it to the 'Any item' selection you can select whatever booking dates. Is the expected behavior? If so I can sign-off. Created attachment 170066 [details] [review] Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod) This patch sets the flatpickr maxDate in the bookings range picker to the startdate selected + issuelength + renewals * renewalperiod circulation rules. Test plan 1) Set an item in a test biblio to 'bookable' from the items tab. 2) Note the itemtype of the above item 3) Add circulation rules for the above item type, in particular the 'Loan period', 'Renewals allowed' and 'Renewal period' options. 4) Go back to your biblio and 'Place booking'. Select a user, pickup location and item. 5) Open the booking dates flatpickr. 6) Select a start date. 7) Note that the date that is 'Loan period' + 'Renewals allowed' * 'Renewal period' is now greyed out and cannot be selected or any date beyond it either. Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Created attachment 170067 [details] [review] Bug 37354: Add visual hint at usual loan periods This patch adds a visual hint to the datepicker to highlight dates that line up with normal loan and renewal lengths. We use bold to highlight such dates. Test plan 1) Repeat the test plan for the previous patch 2) Note that once you have selected your first date, that date will become bold, the date a 'Loan period' after the start date will also be bold and you'll also have bold dates for the number of 'Renewals allowed' at each 'Renewal period' beyond the initial 'Loan period' date. Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> (In reply to Sam Lau from comment #15) > In testing I noticed that if you don't select an item and just leave it to > the 'Any item' selection you can select whatever booking dates. Is the > expected behaviour? If so I can sign-off. I'm afraid I couldn't replicate this.. maybe I've fixed it already inadvertently in the work I've continued on during bug 34440. Created attachment 172890 [details] [review] Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod) This patch sets the flatpickr maxDate in the bookings range picker to the startdate selected + issuelength + renewals * renewalperiod circulation rules. Test plan 1) Set an item in a test biblio to 'bookable' from the items tab. 2) Note the itemtype of the above item 3) Add circulation rules for the above item type, in particular the 'Loan period', 'Renewals allowed' and 'Renewal period' options. 4) Go back to your biblio and 'Place booking'. Select a user, pickup location and item. 5) Open the booking dates flatpickr. 6) Select a start date. 7) Note that the date that is 'Loan period' + 'Renewals allowed' * 'Renewal period' is now greyed out and cannot be selected or any date beyond it either. Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Created attachment 172891 [details] [review] Bug 37354: Add visual hint at usual loan periods This patch adds a visual hint to the datepicker to highlight dates that line up with normal loan and renewal lengths. We use bold to highlight such dates. Test plan 1) Repeat the test plan for the previous patch 2) Note that once you have selected your first date, that date will become bold, the date a 'Loan period' after the start date will also be bold and you'll also have bold dates for the number of 'Renewals allowed' at each 'Renewal period' beyond the initial 'Loan period' date. Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Just another rebase Created attachment 173137 [details] [review] Bug 37354: Fix circ rule selections Only expose the bookings calendar picker input if we have enough detail already defined to pick the corresponding circulation rules. We currently use the item pickup location for selecting which rules to apply, this corresponds to hard coding CircControl=ItemHomeLibrary + ItemHomeOrHolding=holdingbranch for this use case. We can't easily change this to match those rules dynamically without rethinking the 'Any item' functionality and displays in the flatpickr. We may revisit this at some point in the future should that become a requirement. Created attachment 173210 [details] [review] Bug 37354: (QA follow-up) Reset periodPicker on rule change This patch clears the periodPicker values when the applied circulation rules change. This prevents selection of one booking period against one set of rules and then a change of item to an itemtype where different rules should apply but the old selected period remaining and thus 'rule breaking' being allowed. Created attachment 173620 [details] [review] Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod) This patch sets the flatpickr maxDate in the bookings range picker to the startdate selected + issuelength + renewals * renewalperiod circulation rules. Test plan 1) Set an item in a test biblio to 'bookable' from the items tab. 2) Note the itemtype of the above item 3) Add circulation rules for the above item type, in particular the 'Loan period', 'Renewals allowed' and 'Renewal period' options. 4) Go back to your biblio and 'Place booking'. Select a user, pickup location and item. 5) Open the booking dates flatpickr. 6) Select a start date. 7) Note that the date that is 'Loan period' + 'Renewals allowed' * 'Renewal period' is now greyed out and cannot be selected or any date beyond it either. Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 173621 [details] [review] Bug 37354: Add visual hint at usual loan periods This patch adds a visual hint to the datepicker to highlight dates that line up with normal loan and renewal lengths. We use bold to highlight such dates. Test plan 1) Repeat the test plan for the previous patch 2) Note that once you have selected your first date, that date will become bold, the date a 'Loan period' after the start date will also be bold and you'll also have bold dates for the number of 'Renewals allowed' at each 'Renewal period' beyond the initial 'Loan period' date. Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 173622 [details] [review] Bug 37354: Fix circ rule selections Only expose the bookings calendar picker input if we have enough detail already defined to pick the corresponding circulation rules. We currently use the item pickup location for selecting which rules to apply, this corresponds to hard coding CircControl=ItemHomeLibrary + ItemHomeOrHolding=holdingbranch for this use case. We can't easily change this to match those rules dynamically without rethinking the 'Any item' functionality and displays in the flatpickr. We may revisit this at some point in the future should that become a requirement. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 173623 [details] [review] Bug 37354: (QA follow-up) Reset periodPicker on rule change This patch clears the periodPicker values when the applied circulation rules change. This prevents selection of one booking period against one set of rules and then a change of item to an itemtype where different rules should apply but the old selected period remaining and thus 'rule breaking' being allowed. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> I am sorry, but I found a glitch: What I did: * Made item bookable on item level: http://localhost:8081/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=114&itemnumber=236#item236 * Itemtype is not bookable. * Update all - all - all circulation rule to: 1 day loan period, 5 renewals of 1 day renewal period. * Try to book it for Henry, pickup in Fairview, item type Books * Select a start date, the dates after the calculated end date are greyed out. * Realize you want a different date. Remove the current dates using X next to field to clear. * Click on calendar: dates are still locked. * Close booking modal, reopen: dates are still locked. Created attachment 174275 [details] [review] Bug 37354: Set maxDate based on issuelength + (renewals * renewalperiod) This patch sets the flatpickr maxDate in the bookings range picker to the startdate selected + issuelength + renewals * renewalperiod circulation rules. Test plan 1) Set an item in a test biblio to 'bookable' from the items tab. 2) Note the itemtype of the above item 3) Add circulation rules for the above item type, in particular the 'Loan period', 'Renewals allowed' and 'Renewal period' options. 4) Go back to your biblio and 'Place booking'. Select a user, pickup location and item. 5) Open the booking dates flatpickr. 6) Select a start date. 7) Note that the date that is 'Loan period' + 'Renewals allowed' * 'Renewal period' is now greyed out and cannot be selected or any date beyond it either. Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 174276 [details] [review] Bug 37354: Add visual hint at usual loan periods This patch adds a visual hint to the datepicker to highlight dates that line up with normal loan and renewal lengths. We use bold to highlight such dates. Test plan 1) Repeat the test plan for the previous patch 2) Note that once you have selected your first date, that date will become bold, the date a 'Loan period' after the start date will also be bold and you'll also have bold dates for the number of 'Renewals allowed' at each 'Renewal period' beyond the initial 'Loan period' date. Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 174277 [details] [review] Bug 37354: Fix circ rule selections Only expose the bookings calendar picker input if we have enough detail already defined to pick the corresponding circulation rules. We currently use the item pickup location for selecting which rules to apply, this corresponds to hard coding CircControl=ItemHomeLibrary + ItemHomeOrHolding=holdingbranch for this use case. We can't easily change this to match those rules dynamically without rethinking the 'Any item' functionality and displays in the flatpickr. We may revisit this at some point in the future should that become a requirement. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 174278 [details] [review] Bug 37354: (QA follow-up) Reset periodPicker on rule change This patch clears the periodPicker values when the applied circulation rules change. This prevents selection of one booking period against one set of rules and then a change of item to an itemtype where different rules should apply but the old selected period remaining and thus 'rule breaking' being allowed. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 174279 [details] [review] Bug 37354: (QA follow-up) Reset state on clear We were missing a reset for flatPickr state when using the clear option for flatPickr. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Pushed for 24.11! Well done everyone, thank you! Enhancement, no 24.05.x backport. Included in the Koha Manual. |