Bug 36341 - "Hold starts on date" should be limited to future dates
Summary: "Hold starts on date" should be limited to future dates
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal (vote)
Assignee: Martin Renvoize
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 35977
  Show dependency treegraph
 
Reported: 2024-03-18 11:34 UTC by Martin Renvoize
Modified: 2024-05-28 16:45 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05.00,23.11.06,23.05.12


Attachments
Bug 36341: Add futureinclusive to future holds (3.63 KB, patch)
2024-03-18 11:40 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 36341: Add futureinclusive to future holds (3.68 KB, patch)
2024-04-01 17:34 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 36341: (QA follow-up) Use future inclusive on staff side too (1.34 KB, patch)
2024-04-01 17:34 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 36341: (follow-up) Fix missing Date_from_syspref (1.97 KB, patch)
2024-04-29 08:40 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 2024-03-18 11:34:51 UTC
For some reason we don't appear to limit the date selection yet available in the OPAC 'Hold starts on date'.. it should only allow future dates.
Comment 1 Martin Renvoize 2024-03-18 11:40:00 UTC
Created attachment 163309 [details] [review]
Bug 36341: Add futureinclusive to future holds

This patch adds the flatpickr-futureinclusive data to the input field
for "Hold starts on date" in the OPAC.

We also add 'flatpickr-future' data to the input field for expiration
date as it also doesn't make sense to allow this to be a past data
either.

Test plan
1) Attempt to place a hold on an item from the OPAC
2) Expand the 'Show more options' dropdown
3) Note that without the patch 'Hold not needed after' allows setting to
   a date in the past.
4) Enable `AllowHoldDateInFuture` and `OPACAllowHoldDateInFuture` system
   preferences
5) The 'Hold starts on date' option should now appear if you refresh
   your hold placing page in the OPAC.
6) Note that the above input also allows setting a past date
7) Apply patch
8) Neith input should allow past dates now.
Comment 2 Nick Clemens (kidclamp) 2024-04-01 17:34:26 UTC
Created attachment 164218 [details] [review]
Bug 36341: Add futureinclusive to future holds

This patch adds the flatpickr-futureinclusive data to the input field
for "Hold starts on date" in the OPAC.

We also add 'flatpickr-future' data to the input field for expiration
date as it also doesn't make sense to allow this to be a past data
either.

Test plan
1) Attempt to place a hold on an item from the OPAC
2) Expand the 'Show more options' dropdown
3) Note that without the patch 'Hold not needed after' allows setting to
   a date in the past.
4) Enable `AllowHoldDateInFuture` and `OPACAllowHoldDateInFuture` system
   preferences
5) The 'Hold starts on date' option should now appear if you refresh
   your hold placing page in the OPAC.
6) Note that the above input also allows setting a past date
7) Apply patch
8) Neith input should allow past dates now.

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 3 Nick Clemens (kidclamp) 2024-04-01 17:34:28 UTC
Created attachment 164219 [details] [review]
Bug 36341: (QA follow-up) Use future inclusive on staff side too
Comment 4 Nick Clemens (kidclamp) 2024-04-01 17:34:40 UTC
Trivial fix, PQA
Comment 5 Katrin Fischer 2024-04-04 13:25:39 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 6 Martin Renvoize 2024-04-29 08:40:53 UTC
Created attachment 165721 [details] [review]
Bug 36341: (follow-up) Fix missing Date_from_syspref

It appears this bug introduces the first actual use of this function in
the OPAC and thus exposes that bug 31261 didn't fully port the
Date_from_syspref from the intranet.
Comment 7 Katrin Fischer 2024-04-29 11:38:34 UTC
Follow-up will be pushed to main today.
Comment 8 Katrin Fischer 2024-04-29 13:20:35 UTC
Pushed for 24.05!

Well done everyone, thank you!
Comment 9 Fridolin Somers 2024-05-23 09:22:18 UTC
Pushed to 23.11.x for 23.11.06
Comment 10 Lucas Gass 2024-05-28 16:45:34 UTC
Backported to 23.05.x for upcoming 23.05.12