<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body>A new request with request id 7235 has been created by koha-devel-request@lists.koha-community.org. Short info on the request is : <br><br>Title : Koha-devel Digest, Vol 202, Issue 16<br>Category : <br>Description : <div>Send Koha-devel mailing list submissions to<br>    koha-devel@lists.koha-community.org<br><br>To subscribe or unsubscribe via the World Wide Web, visit<br>    https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel<br>or, via email, send a message with subject or body 'help' to<br>    koha-devel-request@lists.koha-community.org<br><br>You can reach the person managing the list at<br>    koha-devel-owner@lists.koha-community.org<br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of Koha-devel digest..."<br><br><br>Today's Topics:<br><br>   1. Re: Handling normalized phone number data<br>      (dcook@prosentient.com.au)<br>   2. Re: Handling normalized phone number data<br>      (dcook@prosentient.com.au)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Thu, 15 Sep 2022 10:31:34 +1000<br>From: <dcook@prosentient.com.au><br>To: "'Kyle Hall'" <kyle@bywatersolutions.com><br>Cc: "'koha-devel'" <koha-devel@lists.koha-community.org>, "'Tomas<br>    Cohen Arazi'" <tomascohen@theke.io>, "'Martin Renvoize'"<br>    <martin.renvoize@ptfs-europe.com><br>Subject: Re: [Koha-devel] Handling normalized phone number data<br>Message-ID: <1a8901d8c89a$8f722190$ae5664b0$@prosentient.com.au><br>Content-Type: text/plain; charset="utf-8"<br><br>Glad to hear other folk are interested to store numbers in E.164 too! Like you say, we’re already doing it for SMS numbers, so I think it makes sense to do it for all phone numbers. Kyle, what do you think about my Koha::Patron->phone() method for doing that?<br><br> <br><br>I was thinking how it would be nice to format them for display, but it’s probably easier said than done.<br><br> <br><br>For instance, in Australia, we have several different formats (https://www.stylemanual.gov.au/grammar-punctuation-and-conventions/numbers-and-measurements/telephone-numbers):<br><br>*    0412 345 678 (mobile)<br>*    02 1234 5678 (landline)<br>*    1300 123 456 (nation-wide local rate number)<br>*    13 00 00 (alternative nation-wide local rate number)<br><br> <br><br>It looks like Number::Phone doesn’t support Australian numbers and Number::Phone::Normalize looks old/simple. <br><br> <br><br>David Cook<br><br>Senior Software Engineer<br><br>Prosentient Systems<br><br>Suite 7.03<br><br>6a Glen St<br><br>Milsons Point NSW 2061<br><br>Australia<br><br> <br><br>Office: 02 9212 0899<br><br>Online: 02 8005 0595<br><br> <br><br>From: Kyle Hall <kyle@bywatersolutions.com> <br>Sent: Wednesday, 14 September 2022 8:26 PM<br>To: dcook@prosentient.com.au<br>Cc: koha-devel <koha-devel@lists.koha-community.org>; Tomas Cohen Arazi <tomascohen@theke.io>; Martin Renvoize <martin.renvoize@ptfs-europe.com><br>Subject: Re: Handling normalized phone number data<br><br> <br><br>Storing numbers in E.164 makes sense to me! We already enforce it for SMS numbers, so it would make sense to extend this to all other phone numbers. It would then be trivial to have a phone number format syspref in the same way we have a date format syspref. For searching it would be as simple as stripping all non-numerics from the search term and performing a substring search.<br><br> <br><br>Perhaps Number::Phone or Number::Phone::Normalize would be of use.<br><br> <br><br>Kyle<br><br> <br><br>On Wed, Sep 14, 2022 at 2:43 AM <dcook@prosentient.com.au <mailto:dcook@prosentient.com.au> > wrote:<br><br>Hi all,<br><br> <br><br>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.<br><br> <br><br>Currently, phone number searching doesn’t work if you have punctuation or other formatting inconsistent with your search query. <br><br> <br><br>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.<br><br> <br><br>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. <br><br> <br><br>Thoughts?<br><br> <br><br>David Cook<br><br>Senior Software Engineer<br><br>Prosentient Systems<br><br>Suite 7.03<br><br>6a Glen St<br><br>Milsons Point NSW 2061<br><br>Australia<br><br> <br><br>Office: 02 9212 0899<br><br>Online: 02 8005 0595<br><br> <br><br><br><br>-- <br><br>Kyle M. Hall<br><br>Loose Cannon, ByWater Solutions<br><br> <mailto:kyle@bywatersolutions.com> kyle@bywatersolutions.com<br> <http://bywatersolutions.com/> https://bywatersolutions.com<br><br> <http://bywatersolutions.com/what-is-koha/> What is Koha?<br><br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20220915/eb5d25f2/attachment-0001.htm><br><br>------------------------------<br><br>Message: 2<br>Date: Thu, 15 Sep 2022 10:36:46 +1000<br>From: <dcook@prosentient.com.au><br>To: "'Tomas Cohen Arazi'" <tomascohen@theke.io><br>Cc: "'koha-devel'" <koha-devel@lists.koha-community.org>, "'Kyle<br>    Hall'" <kyle@bywatersolutions.com>, "'Martin Renvoize'"<br>    <martin.renvoize@ptfs-europe.com><br>Subject: Re: [Koha-devel] Handling normalized phone number data<br>Message-ID: <1a8e01d8c89b$4464c350$cd2e49f0$@prosentient.com.au><br>Content-Type: text/plain; charset="utf-8"<br><br>I think at some point both the phone and email details should be moved into their own table(s), and then 1 would get a primary flag. <br><br> <br><br>With the DataTables and REST API, I suppose we could hard-code a join into Koha/REST/V1/Patrons.pm.<br><br> <br><br>If we had a “phone” table, we could potentially store both free-text (potentially formatted) and normalized versions of the phone number. Then we’d just update the patron search to use the normalized version. <br><br> <br><br>But all of that sounds like a lot of effort :/<br><br> <br><br>David Cook<br><br>Senior Software Engineer<br><br>Prosentient Systems<br><br>Suite 7.03<br><br>6a Glen St<br><br>Milsons Point NSW 2061<br><br>Australia<br><br> <br><br>Office: 02 9212 0899<br><br>Online: 02 8005 0595<br><br> <br><br>From: Tomas Cohen Arazi <tomascohen@theke.io> <br>Sent: Wednesday, 14 September 2022 11:10 PM<br>To: dcook@prosentient.com.au<br>Cc: koha-devel <koha-devel@lists.koha-community.org>; Kyle Hall <kyle@bywatersolutions.com>; Martin Renvoize <martin.renvoize@ptfs-europe.com><br>Subject: Re: Handling normalized phone number data<br><br> <br><br>Should we also think of moving phones to their own table?<br><br> <br><br>El mié, 14 sept 2022 a las 3:43, <dcook@prosentient.com.au <mailto:dcook@prosentient.com.au> > escribió:<br><br>Hi all,<br><br> <br><br>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.<br><br> <br><br>Currently, phone number searching doesn’t work if you have punctuation or other formatting inconsistent with your search query. <br><br> <br><br>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.<br><br> <br><br>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. <br><br> <br><br>Thoughts?<br><br> <br><br>David Cook<br><br>Senior Software Engineer<br><br>Prosentient Systems<br><br>Suite 7.03<br><br>6a Glen St<br><br>Milsons Point NSW 2061<br><br>Australia<br><br> <br><br>Office: 02 9212 0899<br><br>Online: 02 8005 0595<br><br> <br><br><br><br><br> <br><br>-- <br><br>Tomás Cohen Arazi<br><br>Theke Solutions (http://theke.io)<br>✆ +54 9351 3513384<br>GPG: B2F3C15F<br><br>-------------- next part --------------<br>An HTML attachment was scrubbed...<br>URL: <http://lists.koha-community.org/pipermail/koha-devel/attachments/20220915/2d4c4898/attachment.htm><br><br>------------------------------<br><br>Subject: Digest Footer<br><br>_______________________________________________<br>Koha-devel mailing list<br>Koha-devel@lists.koha-community.org<br>https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel<br>website : https://www.koha-community.org/<br>git : https://git.koha-community.org/<br>bugs : https://bugs.koha-community.org/<br><br><br>------------------------------<br><br>End of Koha-devel Digest, Vol 202, Issue 16<br>*******************************************<br></div><br><br>NOTE: You are receiving this mail because, the Requester/Technician wanted you to get notified on this request creation.<br></body></html>