Bug 27805: Use input type "email" for email preferences
authorOwen Leonard <oleonard@myacpl.org>
Fri, 26 Feb 2021 12:43:28 +0000 (12:43 +0000)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 6 Apr 2021 13:56:30 +0000 (15:56 +0200)
commit01e4ba089f9fb1961b8562547a8644c40b0b99f0
treefa79b1383244e31f2ac5c3acd229916a7beec3b6
parenta717cc052ef5300ecd7c894901ab72fc4168d747
Bug 27805: Use input type "email" for email preferences

This patch changes the way input fields are output in the system
preferences template for preferences which have an "email" class. The
input type will now be "email" instead of "text."

Email type inputs are "loosely" validated. Mozilla's documentation says
valid patterns are "username@domain or username@domain.tld," so Koha's
default "root@localhost" will still work.

The other advantage of an "email" type input is that it typically
triggers different keyboard options in mobile devices.

To test, apply the patch and go to Administration -> Global system
preferences.

- Search system preferences for "email."
- Test the email type preferences you find (e.g. KohaAdminEmailAddress,
  ReplytoDefault, SendAllEmailsTo), confirming that email
  addresses like username@domain or username@domain.tld work correctly.
- Confirm that any other value triggers a validation error.

Signed-off-by: Amit Gupta <amitddng135@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
admin/preferences.pl