Since Bug 30718, date due uses flatpickr. The JavaScript code setting due date via on-site checkout checkbox needs to be adapted. Sort of like Bug 30717.
Created attachment 148786 [details] [review] Bug 33345: On-site checkout checkbox does not work since issue date using flatpickr WIP
There are other places setting 'duedatespec' input, but they are hidden so not with flatpickr : koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt: $("input[name=duedatespec]:hidden").val('[% HIGHHOLDS.returndate | html %]'); koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt: $("input[name=restoreduedatespec]:hidden").val('highholds_empty'); koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt: $("input[name=restoreduedatespec]:hidden").val('[% duedatespec | html %]'); koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt: $("input[name=duedatespec]:hidden").val(''); koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation_batch_checkouts.tt: $("input[name=duedatespec]:hidden").val('[% checkout_info.HIGHHOLDS.returndate | html %]'); koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt: if ($('#duedatespec').val().length === 0) { koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt: var date_due = flatpickr.parseDate( $('#duedatespec').val(), flatpickr_datetime_string );
Created attachment 148787 [details] [review] Bug 33345: On-site checkout checkbox does not work since issue date using flatpickr Since Bug 30718, date due uses flatpickr. The JavaScript code setting due date via on-site checkout checkbox needs to be adapted. Sort of like Bug 30717. This patch renames the variable sent to template 'today_due_date_and_time' to avoid confusion with variable 'todaysdate' used in other templates. Test plan : 1) Enable system preference 'OnSiteCheckouts' 2) Go to a patron circulation page /cgi-bin/koha/circ/circulation.pl 3) Click on settings icon inside barcode input => Check due date input is empty 4) Click on 'On-site checkout' => Check due date input is filled with today date at 23:59 5) Fill barcode input and do check-out 6) Check due date is correct
Created attachment 149298 [details] [review] Bug 33345: On-site checkout checkbox does not work since issue date using flatpickr Since Bug 30718, date due uses flatpickr. The JavaScript code setting due date via on-site checkout checkbox needs to be adapted. Sort of like Bug 30717. This patch renames the variable sent to template 'today_due_date_and_time' to avoid confusion with variable 'todaysdate' used in other templates. Test plan : 1) Enable system preference 'OnSiteCheckouts' 2) Go to a patron circulation page /cgi-bin/koha/circ/circulation.pl 3) Click on settings icon inside barcode input => Check due date input is empty 4) Click on 'On-site checkout' => Check due date input is filled with today date at 23:59 5) Fill barcode input and do check-out 6) Check due date is correct Signed-off-by: David Nind <david@davidnind.com>
Testing notes (using KTD): 1. If I understand this correctly, if OnSiteCheckouts is enabled: 1.1 Go to check out an item for a patron 1.2 Click on the settings icon in the barcode input field 1.3 Click the tick box next to 'On-site checkouts' 1.4 It should automatically fill in the 'Specify due date' field with today's date and 23:59 as the time 1.5 Before the patch is applied, it doesn't (when it should) 1.6 After the patch is applied, it does (which is what is expected)
Verified that this restores the previous behavior (tested in 20.11).
Created attachment 149363 [details] [review] Bug 33345: On-site checkout checkbox does not work since issue date using flatpickr Since Bug 30718, date due uses flatpickr. The JavaScript code setting due date via on-site checkout checkbox needs to be adapted. Sort of like Bug 30717. This patch renames the variable sent to template 'today_due_date_and_time' to avoid confusion with variable 'todaysdate' used in other templates. Test plan : 1) Enable system preference 'OnSiteCheckouts' 2) Go to a patron circulation page /cgi-bin/koha/circ/circulation.pl 3) Click on settings icon inside barcode input => Check due date input is empty 4) Click on 'On-site checkout' => Check due date input is filled with today date at 23:59 5) Fill barcode input and do check-out 6) Check due date is correct Signed-off-by: David Nind <david@davidnind.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Pushed to master for 23.05. Nice work everyone, thanks!
Nice work everyone! Pushed to stable for 22.11.x
Missing 22.05.x dependencies, no backport.