]> git.evergreen-ils.org Git - working/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:15 +0000 (16:49 -0500)
commit1b20e4efac59e9374abd2746eb0419938ca4fc4f
tree06acc1f9b1bb413a17b44c612b13bccbbc0fdef9
parente8cb39dfeb5702c99dc75ffc29d2c77fbf4dec66
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