Bug 39882

Summary: Add phone number masking option
Product: Koha Reporter: Lucas Gass (lukeg) <lucas>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: brandon, danielle.meininger, dcook
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23817
GIT URL: Change sponsored?: ---
Patch complexity: --- Documentation contact:
Documentation submission: Text to go in the release notes:
Version(s) released in:
Circulation function:

Description Lucas Gass (lukeg) 2025-05-12 19:25:30 UTC
It would be nice it we should add a mask for phone number fields. For certain things, like Twilio, it is important that a phone number gets set in an exact format. 

We have Maskito for date entry, we might be able to leverage that for phone numbers:

https://maskito.dev/recipes/phone
Comment 1 Danielle 2025-05-13 18:43:28 UTC
I like that idea too. Would this be something we could setup individually or a global system preference with a few options to choose from?
Comment 2 Brandon 2025-09-23 22:24:19 UTC
+1 for this feature. Phone number fields should not be plain text inputs. Just a recipe for bad data.
Comment 3 Lucas Gass (lukeg) 2025-09-25 13:21:33 UTC
(In reply to Brandon from comment #2)
> +1 for this feature. Phone number fields should not be plain text inputs.
> Just a recipe for bad data.

The correct way to do this is probably Bug 23817, normalize all phone numbers in patron search and DB.
Comment 4 David Cook 2025-09-26 01:48:28 UTC
(In reply to Lucas Gass (lukeg) from comment #3)
> (In reply to Brandon from comment #2)
> > +1 for this feature. Phone number fields should not be plain text inputs.
> > Just a recipe for bad data.
> 
> The correct way to do this is probably Bug 23817, normalize all phone
> numbers in patron search and DB.

Funny enough I was just talking last night about how I should resurrect this for main. I've been using it locally for the past 2 years and it's nice. 

That said, formatting phone numbers for display purposes at least could be cool.
Comment 5 David Cook 2025-09-26 01:50:17 UTC
(In reply to David Cook from comment #4)
> Funny enough I was just talking last night about how I should resurrect this
> for main. I've been using it locally for the past 2 years and it's nice. 

Let me know if you'd like me to post some updated patches. I could certainly make some time for that, if you're interested in it.