]> git.evergreen-ils.org Git - Evergreen.git/commit
LP1755625: Multiple emails in patron editor
authorJason Boyer <jboyer@library.in.gov>
Thu, 15 Nov 2018 16:43:30 +0000 (11:43 -0500)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 16 Nov 2018 21:49:38 +0000 (16:49 -0500)
commit8a1de53fe3730eac365cf31e9e70ee104cb4347a
tree2e92334e19a30367c4d22726a9f37cde5a6c1346
parent14d6af63440fb724de475e6bc37dce941b19f1e5
LP1755625: Multiple emails in patron editor

Even though the HTML5 "email" input type allows multiple
addresses to be separated by commas there is nothing that
can be done to signal to Angular.js that this is ok; it
will only ever accept a single address. This patch forces
the type of the input tag to plain text so Angular will
rely on any supplied regex to verify the entry.

The ui.patron.edit.au.email.regex (Regex for email field on patron
registration) library setting can be used to control whether
one or multiple email addresses will be permitted on the
patron registration form.

To allow multiple addresses, that setting can be:

^(?:(?:\b[^@,\s]+@[^@,\s]+\.[^@.,\s]+\b)(?:,\s?(?!$)|$))*$

To allow only a single address, use:

^(?:\b[^@,\s]+@[^@,\s]+\.[^@.,\s]+\b)$

To test
-------
[1] In the web staff client, try to register a new patron, entering
    multiple email addresseses in the email field separated by
    commas.
[2] Note that the email field displays as invalid and the
    record cannot be saved.
[3] Apply the patch and repeat step #1, This time, the email
    field should accept multiple addresses.
[4] Set the Regex for email field on patron registration library
    setting to the multiple-email form listed above. Reload
    the patron registration form and verify that it will
    continue to accept multiple email addresses but will not
    accept entry that doesn't look like an email address.
[5] Set the library setting to the single-address value. Reload
    the patron registration form; this time it should accept
    a valid email address but not multiple ones.

Signed-off-by: Jason Boyer <jboyer@library.in.gov>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Cesar Velez <cesar.velez@equinoxinitiative.org>
Open-ILS/src/templates/staff/circ/patron/t_edit.tt2