When using "Suspend all holds" in "circulation" and "moremember" templates, patron is able to select past dates. This doesn't occur when suspending individual holds.
Created attachment 91327 [details] [review] Bug 23268: "Suspend all holds" calendar allows to select past date This patch removes "circulation" and moremember" templates functions for Datepicker plugin. They now use options common for all inputs with "datepicker" class and get "minDate" option from id assigned function in "calender.inc" To test: - Apply patch - Add holds for patron - Use "Suspend all holds" calendar =>Calendar greys out dates past from today
I wish I understood why this bug exists! Looking at the code I don't understand what we're doing wrong. However, seeing the change made in calendar.inc gives me the idea that we might apply a fix which is more generalized: We could use the jQueryUI datepicker's "option" method to apply a special configuration if the date field has a particular class: $(".futuredate").datepicker("option", { minDate: 1 }); Then we modify the suspend_until fields: <input type="text" size="10" id="suspend_until" name="suspend_until" class="datepicker futuredate"/> I would prefer this to adding code to calendar.inc which targets a specific ID. What do you think?
I agree, generalizing this works far better.
Created attachment 91400 [details] [review] Bug 23268: "Suspend all holds" calendar allows to select past date This patch removes "circulation" and moremember" templates functions for Datepicker plugin. They now use options common for all inputs with "datepicker" class and get "minDate" option from class "futuredate" assigned function in "calender.inc". To test: - Apply patch - Add holds for patron - Use "Suspend all holds" calendar =>Calendar greys out dates past from today
Tested in my dev environment, and works perfectly as per test plan.
Created attachment 100452 [details] [review] Bug 23268: Make "Suspend all holds" calendar select a date from tomorrow This patch removes "circulation" and moremember" templates functions for Datepicker plugin. They now use options common for all inputs with "datepicker" class and get "minDate" option from class "futuredate" assigned function in "calender.inc". To test: - Apply patch - Add holds for patron - Use "Suspend all holds" calendar =>Calendar greys out dates past from today Signed-off-by: David Roberts <david.roberts@ptfs-europe.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Amended patch: Align .futuredate in calendar.inc
Note: the value still can be forced if the input is edited manually.
Nice work everyone! Pushed to master for 20.05
Backported to 19.11.x for 19.11.05
enhancement will not be backported to 19.05.x