Bug 20439

Summary: SMS provider sorting
Product: Koha Reporter: George Williams (NEKLS) <george>
Component: PatronsAssignee: Lucas Gass <lucas>
Status: CLOSED FIXED QA Contact: Martin Renvoize <martin.renvoize>
Severity: enhancement    
Priority: P5 - low CC: arthur.suzuki, barbara.johnson, bhenry, bugzilla, george, gmcharlt, kyle.m.hall, lisettepalouse+koha, lucas, martin.renvoize, stlit, victor
Version: unspecified   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
22.11.00, 22.05.05, 21.11.12
Attachments: Bug 20439: Sort SMS providers in alphabetical order
Bug 20439: Sort SMS providers in alphabetical order
Bug 20439: Sort SMS providers in alphabetical order by DB field
Bug 20439: Sort SMS providers in alphabetical order by DB field

Description George Williams (NEKLS) 2018-03-16 22:19:56 UTC
On intranet memberentry.pl and on OPAC opac-messaging.pl the SMS provider drop-down is sorted in the order the provider was added rather than alphabetically by provider name - making it difficult for library staff and for borrowers to find providers not added in alphabetical order.
Comment 1 Lisette Scheer 2019-08-14 16:06:59 UTC
This is still an issue in 18.11
Comment 2 George Williams (NEKLS) 2020-11-24 21:07:39 UTC
*** Bug 26837 has been marked as a duplicate of this bug. ***
Comment 3 Lucas Gass 2022-07-11 20:03:39 UTC
Created attachment 137579 [details] [review]
Bug 20439: Sort SMS providers in alphabetical order

To test:
1/ Add 'Email' to the 'SMSSendDriver' system preference.
2/ Make sure 'EnhancedMessagingPreferencesOPAC' and 'EnhancedMessagingPreferences' are turned on.
3/ Add some SMS providers (/cgi-bin/koha/admin/sms_providers.pl) with different names.
4/ Notice on memberentry.pl and opac-messaging.pl the SMS providers sort by when they were added, not alphabetically.
5/ Apply patch and restart services.
6/ Look at memberentry.pl and opac-messaging.pl and notice that they SMS providers now sort alphabetically.
Comment 4 ByWater Sandboxes 2022-07-11 20:41:31 UTC
Created attachment 137590 [details] [review]
Bug 20439: Sort SMS providers in alphabetical order

To test:
1/ Add 'Email' to the 'SMSSendDriver' system preference.
2/ Make sure 'EnhancedMessagingPreferencesOPAC' and 'EnhancedMessagingPreferences' are turned on.
3/ Add some SMS providers (/cgi-bin/koha/admin/sms_providers.pl) with different names.
4/ Notice on memberentry.pl and opac-messaging.pl the SMS providers sort by when they were added, not alphabetically.
5/ Apply patch and restart services.
6/ Look at memberentry.pl and opac-messaging.pl and notice that they SMS providers now sort alphabetically.

Signed-off-by: George Williams <george@nekls.org>
Comment 5 Martin Renvoize 2022-07-15 15:37:21 UTC
Shouldn't this be sorted by DB field in the query Lucas, rather than after the fact in perl?
Comment 6 Lucas Gass 2022-07-15 16:57:01 UTC
Created attachment 137786 [details] [review]
Bug 20439: Sort SMS providers in alphabetical order by DB field

To test:
1/ Add 'Email' to the 'SMSSendDriver' system preference.
2/ Make sure 'EnhancedMessagingPreferencesOPAC' and 'EnhancedMessagingPreferences' are turned on.
3/ Add some SMS providers (/cgi-bin/koha/admin/sms_providers.pl) with different names.
4/ Notice on memberentry.pl and opac-messaging.pl the SMS providers sort by when they were added, not alphabetically.
5/ Apply patch and restart services.
6/ Look at memberentry.pl and opac-messaging.pl and notice that they SMS providers now sort alphabetically.
Comment 7 Martin Renvoize 2022-07-16 09:21:23 UTC
Awesome, thanks Lucas. I'll take a look at straight QAing this on Monday.. unless someone gets a signoff in in the mean time :-)
Comment 8 Martin Renvoize 2022-07-18 09:04:19 UTC
Created attachment 137800 [details] [review]
Bug 20439: Sort SMS providers in alphabetical order by DB field

To test:
1/ Add 'Email' to the 'SMSSendDriver' system preference.
2/ Make sure 'EnhancedMessagingPreferencesOPAC' and 'EnhancedMessagingPreferences' are turned on.
3/ Add some SMS providers (/cgi-bin/koha/admin/sms_providers.pl) with different names.
4/ Notice on memberentry.pl and opac-messaging.pl the SMS providers sort by when they were added, not alphabetically.
5/ Apply patch and restart services.
6/ Look at memberentry.pl and opac-messaging.pl and notice that they SMS providers now sort alphabetically.

Signed-off-by: George Williams <george@nekls.org
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 9 Martin Renvoize 2022-07-18 09:04:42 UTC
Great work, works as expected

Passing QA
Comment 10 Tomás Cohen Arazi 2022-07-18 17:55:38 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!
Comment 11 Lucas Gass 2022-08-23 19:25:49 UTC
Backported to 22.05.x for 22.05.05
Comment 12 George Williams (NEKLS) 2022-08-23 19:42:02 UTC
If this could be backported to 21.11, that would be awesome.
Comment 13 Arthur Suzuki 2022-08-30 09:23:37 UTC
thx pushed to 21.11.x for 21.11.12
Comment 14 Victor Grousset/tuxayo 2022-09-14 19:09:21 UTC
Not backported to oldoldstable (21.05.x). Feel free to ask if it's needed.

Nothing to document, marking resolved.