[Bug 14060] New: Remove readonly on date inputs
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 Bug ID: 14060 Summary: Remove readonly on date inputs Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: jonathan.druart@biblibre.com Reporter: jonathan.druart@biblibre.com QA Contact: testopia@bugs.koha-community.org Currently some inputs use datepicker (or datetimepicker) with a readonly attributes. That can cause accessibility issues. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=10995 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 --- Comment #1 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 38484 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38484&action=edit Bug 14060: Remove readonly attributes on date inputs In order to remove accessibility issues due to the readonly attributes on date inputs, this patch will remove them and introduce a javascript validation on them. This patch is not perfect for some reason: I didn't manage to force the user to select a valid date. One solution would be to reopen the datepicker plugin until a valid date is inserted. But it could be annoying for users (and for me: I did not manage to implement this solution). You will note that input is emptied if the date is not valid. This is a quick and efficient solution to prevent submitting invalid date and make Koha explodes. A proper solution would be to implement the check server side send a friendly message to the user. Test plan: For all inputs, try an invalid and a valid date. 1/ Debar a patron 2/ On the checkout tables (circulation and moremember), add a renewal due date (at the bottom of the tables) 3/ On the checkout page, specify a due date 4/ On the return page, specify a return date 5/ On the invoice page (acquisition module), enter a shipment and billing date 6/ On the invoice search page (invoices.pl) use filters shipment and billing dates 7/ On the offline circ page, specify a due date 8/ On the edit patron page (memberentry), add a debarment 9/ On the reserve page (reserve/request.pl), use the date inputs to suspend until a defined date 10/ Edit patrons in a batch (tools/modborrowers.pl) and use the registration and expiry date inputs -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de --- Comment #2 from Jonathan Druart <jonathan.druart@biblibre.com> --- *** Bug 10995 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=12072 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch --- Comment #3 from Marc Véron <veron@veron.ch> --- Maybe the current date format could be displayed in the alert message? Something like: alert(MSG_PLEASE_ENTER_A_VALID_DATE '('+ dateformat + ')'); --- I found following place without validation: Go to Detail of a patron with hold(s) Select Tab Hold Date field near "Suspend all holds until" allows wrong date format, e.g. "12345678" -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 38540 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38540&action=edit Bug 14060: Add OnClose event on missing datepicker The "suspend until" inputs (hold list on circ/circulation.pl and members/moremember.pl) were not set in the same way. The minDate option should be set for both (bug 10703 removed it for circ/circulation.pl). This patch reintroduces the option and add the OnClose event on both. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 --- Comment #5 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 38541 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=38541&action=edit Bug 14060: Display the date format on the warning popup The date format is now displayed on the warning popup. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 --- Comment #6 from Jonathan Druart <jonathan.druart@biblibre.com> --- *** Bug 11448 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 Zeno Tajoli <z.tajoli@cineca.it> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=14870 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 Nicole C. Engard <nengard@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply CC| |nengard@gmail.com --- Comment #7 from Nicole C. Engard <nengard@gmail.com> --- g13:42 ~/kohaclone (master % u=)$ git qa 14060 Note: checking out 'origin/master'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b new_branch_name HEAD is now at fd12390... Bug 15010: Import patron tool creates 'duplicate' restrictions ( debarments ) Branch bug14060-qa set up to track remote branch master from origin. Switched to a new branch 'bug14060-qa' Bug 14060 - Remove readonly on date inputs 38484 - Bug 14060: Remove readonly attributes on date inputs 38540 - Bug 14060: Add OnClose event on missing datepicker 38541 - Bug 14060: Display the date format on the warning popup Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 14060: Remove readonly attributes on date inputs Using index info to reconstruct a base tree... Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/tools/modborrowers.tt Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/circ/offline.tt Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoices.tt Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/acqui/invoice.tt Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/calendar.inc Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc Applying: Bug 14060: Add OnClose event on missing datepicker Applying: Bug 14060: Display the date format on the warning popup 13:43 ~/kohaclone (bug14060-qa % u+3)$ -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #38484|0 |1 is obsolete| | Attachment #38540|0 |1 is obsolete| | Attachment #38541|0 |1 is obsolete| | --- Comment #8 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 44542 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44542&action=edit Bug 14060: Remove readonly attributes on date inputs In order to remove accessibility issues due to the readonly attributes on date inputs, this patch will remove them and introduce a javascript validation on them. This patch is not perfect for some reason: I didn't manage to force the user to select a valid date. One solution would be to reopen the datepicker plugin until a valid date is inserted. But it could be annoying for users (and for me: I did not manage to implement this solution). You will note that input is emptied if the date is not valid. This is a quick and efficient solution to prevent submitting invalid date and make Koha explodes. A proper solution would be to implement the check server side send a friendly message to the user. Test plan: For all inputs, try an invalid and a valid date. 1/ Debar a patron 2/ On the checkout tables (circulation and moremember), add a renewal due date (at the bottom of the tables) 3/ On the checkout page, specify a due date 4/ On the return page, specify a return date 5/ On the invoice page (acquisition module), enter a shipment and billing date 6/ On the invoice search page (invoices.pl) use filters shipment and billing dates 7/ On the offline circ page, specify a due date 8/ On the edit patron page (memberentry), add a debarment 9/ On the reserve page (reserve/request.pl), use the date inputs to suspend until a defined date 10/ Edit patrons in a batch (tools/modborrowers.pl) and use the registration and expiry date inputs -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 44543 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44543&action=edit Bug 14060: Add OnClose event on missing datepicker The "suspend until" inputs (hold list on circ/circulation.pl and members/moremember.pl) were not set in the same way. The minDate option should be set for both (bug 10703 removed it for circ/circulation.pl). This patch reintroduces the option and add the OnClose event on both. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 44544 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=44544&action=edit Bug 14060: Display the date format on the warning popup The date format is now displayed on the warning popup. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #11 from Owen Leonard <oleonard@myacpl.org> --- Testing with date format "MM/DD/YYYY": In the "specify due date" field I was able to enter "11/1/2015" without any error. When I checked out the item it ignored the invalid date and used the default due date. In the "Renewal due date" field I was able to enter "11/1/2015" without any error. When I clicked the renew button the AJAX renewal process was started but never finished. Firebug reveals the error in the AJAX response: "The given date (11/1/2007) does not match the date format (us) at /home/oleonard/kohaclone/Koha/DateUtils.pm line 153." -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Hi Owen, Could you detail how you managed to insert an invalid date? -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 --- Comment #13 from Owen Leonard <oleonard@myacpl.org> --- (In reply to Jonathan Druart from comment #12)
Could you detail how you managed to insert an invalid date?
I typed it in the date input field. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 45282 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=45282&action=edit Bug 14060: Force the input to contain a valid date Before this patch, the user was still allowed to enter a valid date. Now, if the date is not valid, the input is emptied. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Owen Leonard from comment #13)
(In reply to Jonathan Druart from comment #12)
Could you detail how you managed to insert an invalid date?
I typed it in the date input field.
Indeed :) I was using another version of the code. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 Kyle M Hall <kyle@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kyle@bywatersolutions.com Status|Passed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #16 from Marc Véron <veron@veron.ch> --- Hi Jonathan, Sorry, I found following issues: 1) Syspref dateformat = dmydot (01.10.2017) is not covered by the function is_valid_date Symptom 1: - Set syspref dateformat to dmydot, clear browser chache - Try to add a manual restriction on moremember.pl - manually enter 26.01.2017 - hit 'Add restriction' Result: restriction is added with empty date = indefinite restriction. Symptom 2: - manually enter 1.1.2018 - hit enter - Message appears "Please enter valid date...", closes automatically after ca. 1 second Result: restriction is added with empty date = indefinite restriction. 2) Software error in following cases Case 1: - Set syspref dateformat to dd/mm/yyyy, clear browser cache - manually enter 1/10/2017 - hit 'Add restriction' Result: Software error: The given date (1/10/2017) does not match the date format (metric) at /usr/share/kohaclone/Koha/DateUtils.pm line 153. Case 2: - Set syspref to yyyy-mm-dd - manually enter 2017-2-2 - hit 'Add Restiction' Result: Software error: The given date (2018-2-2) does not match the date format (iso) at /usr/share/kohaclone/Koha/DateUtils.pm line 153. It seems that the timepicker's function parseDate accepts such dates. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 --- Comment #17 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 46224 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=46224&action=edit Bug 14060: Add support for dmydot -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14060 --- Comment #18 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Marc Véron from comment #16)
Hi Jonathan,
Sorry, I found following issues:
1) Syspref dateformat = dmydot (01.10.2017) is not covered by the function is_valid_date
Symptom 1: - Set syspref dateformat to dmydot, clear browser chache - Try to add a manual restriction on moremember.pl - manually enter 26.01.2017 - hit 'Add restriction' Result: restriction is added with empty date = indefinite restriction.
Symptom 2: - manually enter 1.1.2018 - hit enter - Message appears "Please enter valid date...", closes automatically after ca. 1 second Result: restriction is added with empty date = indefinite restriction.
Should be fixed with the last patch.
2) Software error in following cases
Case 1: - Set syspref dateformat to dd/mm/yyyy, clear browser cache - manually enter 1/10/2017 - hit 'Add restriction' Result: Software error: The given date (1/10/2017) does not match the date format (metric) at /usr/share/kohaclone/Koha/DateUtils.pm line 153.
Case 2: - Set syspref to yyyy-mm-dd - manually enter 2017-2-2 - hit 'Add Restiction' Result: Software error: The given date (2018-2-2) does not match the date format (iso) at /usr/share/kohaclone/Koha/DateUtils.pm line 153.
It seems that the timepicker's function parseDate accepts such dates.
I don't manage to force the leading zeros, suggestions are welcome. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org