Koha/koha-tmpl/opac-tmpl/bootstrap/en/includes
Owen Leonard efeed28f7f Bug 27668: Improve validation of patron entry form in the OPAC
This patch improves the way we handle required fields in the patron
entry/update form in the OPAC. Instead of doing multiple checks for each
field using mandatory.defined(), the template now loops over a list of
fields and sets a "required" variable for any which are required.

Then, for each form field, the "required" variable is used to set
classes on labels, input fields, and the "required" text hints. The
class on form fields acts as a hook for the jQuery validator plugin. The
class on the text hints allows us to hide the text hint using CSS,
eliminating the necessity of using a template conditional.

The patch also adds the missing validator-strings include which enables
translation of the jQuery validator plugin's validation error messages.

To test, apply the patch and rebuild the OPAC CSS
(https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client).

 - Go to Administration -> System preferences and enable
   PatronSelfRegistration.
 - Select multiple fields to be required using the
   PatronSelfRegistrationBorrowerMandatoryField preference.
 - In the OPAC, start the process of registering for an account.
 - The fields you designated as mandatory should each have a "Required"
   label under them.
 - Try to submit the form without entering any data. The required fields
   should now be highlighted in red and have another label, "This field
   is  required."
 - Fill in the required fields and submit the form. It should submit
   correctly.
 - Modify the PatronSelfRegistrationBorrowerMandatoryField preference
   and select all fields as mandatory. Confirm that all fields in the
   patron entry form work correctly.
 - Test that form validation works correctly when modifying a logged-in
   patron's existing account.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2021-03-05 13:38:58 +01:00
..
account-table.inc Bug 26697: Make account.inc consistent between staff and opac 2020-11-10 15:00:14 +01:00
accounts.inc Bug 26697: Make account.inc consistent between staff and opac 2020-11-10 15:00:14 +01:00
authorities-search-results.inc
av-build-dropbox.inc Bug 27297: Add required and blank options to av-build-dropbox.inc 2021-01-19 16:03:34 +01:00
biblio-title-head.inc
biblio-title.inc
bodytag.inc Bug 25765: Replace LoginBranchname and LoginBranchcode with use of Branches template plugin 2020-07-23 11:17:27 +02:00
calendar.inc Bug 20168: Update of the OPAC bootstrap template to bootstrap v4 2020-09-09 14:13:03 +02:00
columns_settings.inc Bug 27005: (follow-up) Add missing aria-hidden attributes 2021-02-08 17:09:32 +01:00
datatables.inc Bug 25909: Recent change to datatables JS in the OPAC causes errors 2020-07-16 15:33:29 +01:00
date-format.inc
doc-head-close.inc Bug 26454: Add system preference to set meta description for the OPAC 2020-09-30 16:15:34 +02:00
doc-head-open.inc Bug 24732: Set DumpTemplateVars Dumper options for Indent and Sort 2020-03-02 10:08:31 +00:00
greybox.inc
holds-table.inc Bug 22752: (follow-up) Add style; Only show message about item-level holds 2021-01-21 16:23:35 +01:00
html_helpers.inc Bug 22880: Convert opacheader system preference to news block 2020-02-24 13:24:12 +00:00
i18n.inc
ill-availability-table.inc Bug 23173: (follow-up) Fix QA script errors 2020-04-06 11:05:14 +01:00
item-status-schema-org.inc
item-status.inc Bug 27090: Opac basket: fix the 'In transit from' and 'to' 2021-01-11 10:05:19 +01:00
js-date-format.inc Bug 24980: (follow-up) return '' when date is null 2020-05-01 08:14:34 +01:00
masthead-langmenu.inc Bug 20168: Update of the OPAC bootstrap template to bootstrap v4 2020-09-09 14:13:03 +02:00
masthead-sci.inc Bug 20168: Update of the OPAC bootstrap template to bootstrap v4 2020-09-09 14:13:03 +02:00
masthead-sco.inc Bug 20168: Update of the OPAC bootstrap template to bootstrap v4 2020-09-09 14:13:03 +02:00
masthead.inc Bug 18506: (QA follow-up) Indentation and more conditionals 2021-02-09 09:48:35 +01:00
navigation.inc
opac-authorities.inc
opac-bottom.inc Bug 27571: "Add to lists" on MARC and ISBD view of OPAC detail page doesn't open in new window 2021-02-01 16:36:38 +01:00
opac-detail-sidebar.inc Bug 20168: Update of the OPAC bootstrap template to bootstrap v4 2020-09-09 14:13:03 +02:00
opac-facets.inc Bug 26881: Remove period on limit to available items on opac 2020-11-03 10:57:35 +01:00
opac-note.inc Bug 22672: Change <i> to <em> and <b> to <strong> in templates, includes, xslt 2020-06-29 12:37:02 +02:00
opac-topissues.inc Bug 20168: Update of the OPAC bootstrap template to bootstrap v4 2020-09-09 14:13:03 +02:00
openlibrary-readapi.inc Bug 26148: OpenLibrary "Preview" link target is unclear to patrons 2020-11-05 15:24:20 +01:00
overdrive-checkout.inc Bug 20168: Update of the OPAC bootstrap template to bootstrap v4 2020-09-09 14:13:03 +02:00
overdrive-login.inc Bug 26753: Set focus for cursor to password field on Overdrive login popup on OPAC 2020-11-03 10:57:35 +01:00
page-numbers.inc Bug 20168: Update of the OPAC bootstrap template to bootstrap v4 2020-09-09 14:13:03 +02:00
password_check.inc Bug 23816: Add minimum password length and require strong password overrides by category 2020-09-09 15:39:52 +02:00
patron-title.inc
recordedbooks-checkout.inc Bug 20168: Update of the OPAC bootstrap template to bootstrap v4 2020-09-09 14:13:03 +02:00
resort_form.inc Bug 25014: Fix capitalization for "Call Number" in staff and OPAC sort options 2020-04-03 14:26:34 +01:00
shelfbrowser.inc Bug 26921: Don't generate an invalid custom cover image if the url cannot be generated 2020-12-21 10:07:48 +01:00
slip-print.inc
subtypes_unimarc.inc
title-actions-menu.inc Bug 27731: Remove hold class from individual OPAC search result hold link 2021-02-23 13:12:56 +01:00
user-star-ratings.inc Bug 25110: (QA follow-up) Add aria-hidden="true" to FA icons 2020-04-29 17:04:51 +01:00
usermenu.inc Bug 20936: Add patron's hold history menu in OPAC 2020-11-11 15:55:48 +01:00
validator-strings.inc Bug 27668: Improve validation of patron entry form in the OPAC 2021-03-05 13:38:58 +01:00
xslt-handler.inc