Bug 27805 - Use input type "email" for email preferences
Summary: Use input type "email" for email preferences
Status: Pushed to master
Alias: None
Product: Koha
Classification: Unclassified
Component: System Administration (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-26 12:42 UTC by Owen Leonard
Modified: 2021-05-25 10:14 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Text to go in the release notes:
This patch modifies the global system preferences interface so that fields which ask for an email address have the correct HTML attribute type: email. This allows some basic email address validation by the browser and can enable different keyboard options on devices with onscreen keyboards.
Version(s) released in:
21.05.00


Attachments
Bug 27805: Use input type "email" for email preferences (1.77 KB, patch)
2021-03-04 14:53 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27805: Use input type "email" for email preferences (1.82 KB, patch)
2021-03-24 10:04 UTC, Amit Gupta
Details | Diff | Splinter Review
Bug 27805: (follow-up) Update more instances (3.46 KB, patch)
2021-03-29 12:00 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 27805: Use input type "email" for email preferences (1.88 KB, patch)
2021-04-03 14:14 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 27805: (follow-up) Update more instances (3.52 KB, patch)
2021-04-03 14:14 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Owen Leonard 2021-02-26 12:42:06 UTC
We already have "class: email" in the pref files, we should check for that value when generating the markup.
Comment 1 Owen Leonard 2021-03-04 14:53:20 UTC Comment hidden (obsolete)
Comment 2 Amit Gupta 2021-03-24 10:04:51 UTC Comment hidden (obsolete)
Comment 3 Katrin Fischer 2021-03-27 16:52:35 UTC
Hi Owen,

this works for most, but I found some we still need to set the email class for:

NoticeBcc  
ILLDefaultStaffEmail
PayPalUser
EmailSMSSendDriverFromAddress 

Could we deal with those in a follow-up please?
Comment 4 Owen Leonard 2021-03-29 12:00:24 UTC Comment hidden (obsolete)
Comment 5 Katrin Fischer 2021-04-03 14:14:20 UTC
Created attachment 119155 [details] [review]
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>
Comment 6 Katrin Fischer 2021-04-03 14:14:24 UTC
Created attachment 119156 [details] [review]
Bug 27805: (follow-up) Update more instances

This patch updates some preferences I missed in the first round:

- NoticeBcc
- ILLDefaultStaffEmail
- PayPalUser
- EmailSMSSendDriverFromAddress

I've also modified the preferences CSS so that fields with type "email"
are styled the same as fields with the "long" class to give more room
for email addresses.

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 7 Jonathan Druart 2021-04-06 13:57:59 UTC
Pushed to master for 21.05, thanks to everybody involved!
Comment 8 Fridolin Somers 2021-04-15 11:20:44 UTC
Enhancement not pushed to 20.11.x