[Koha-devel] Handling normalized phone number data
dcook at prosentient.com.au
dcook at prosentient.com.au
Wed Sep 14 08:42:55 CEST 2022
Hi all,
I've been working lately on
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=23817 in an effort
to let staff users easily search phone numbers in the Patrons module.
Currently, phone number searching doesn't work if you have punctuation or
other formatting inconsistent with your search query.
So I'm proposing normalizing phone numbers. Normalizing the search query is
easy, but normalizing the data in the database is harder. In older versions
of Koha, I used SQL to normalize the phone column in the WHERE clause, but
that's seemingly impossible now that we're using DataTables and the REST
API.
So it seems to me the only way forward is to normalize the data in the
database. I've attached a patch which provides a Koha::Patron->phone() set
method which normalizes the phone number before it's saved in the database,
but I don't know what other Koha folk think about that.
Thoughts?
David Cook
Senior Software Engineer
Prosentient Systems
Suite 7.03
6a Glen St
Milsons Point NSW 2061
Australia
Office: 02 9212 0899
Online: 02 8005 0595
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20220914/cc5f2cca/attachment.htm>
More information about the Koha-devel
mailing list