Bugzilla – Attachment 137786 Details for
Bug 20439
SMS provider sorting
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20439: Sort SMS providers in alphabetical order by DB field
Bug-20439-Sort-SMS-providers-in-alphabetical-order.patch (text/plain), 2.12 KB, created by
Lucas Gass (lukeg)
on 2022-07-15 16:57:01 UTC
(
hide
)
Description:
Bug 20439: Sort SMS providers in alphabetical order by DB field
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2022-07-15 16:57:01 UTC
Size:
2.12 KB
patch
obsolete
>From e2c3c022552c0c6a319c40de87a181d0f9da8d64 Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Fri, 15 Jul 2022 16:55:53 +0000 >Subject: [PATCH] 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. >--- > members/memberentry.pl | 2 +- > opac/opac-messaging.pl | 6 ++++-- > 2 files changed, 5 insertions(+), 3 deletions(-) > >diff --git a/members/memberentry.pl b/members/memberentry.pl >index d406817ecd..6a42ebd938 100755 >--- a/members/memberentry.pl >+++ b/members/memberentry.pl >@@ -68,7 +68,7 @@ if ( $borrowernumber and not $patron ) { > } > > if ( C4::Context->preference('SMSSendDriver') eq 'Email' ) { >- my @providers = Koha::SMS::Providers->search->as_list; >+ my @providers = Koha::SMS::Providers->search( {}, { order_by => 'name' } )->as_list; > $template->param( sms_providers => \@providers ); > } > >diff --git a/opac/opac-messaging.pl b/opac/opac-messaging.pl >index 01faeb3cf4..a221b39a83 100755 >--- a/opac/opac-messaging.pl >+++ b/opac/opac-messaging.pl >@@ -79,8 +79,10 @@ $template->param( > TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification") ); > > if ( C4::Context->preference("SMSSendDriver") eq 'Email' ) { >- my $providers = Koha::SMS::Providers->search; >- $template->param( sms_providers => $providers, sms_provider_id => $patron->sms_provider_id ); >+ my @providers = Koha::SMS::Providers->search( {}, { order_by => 'name' } )->as_list; >+ $template->param( >+ sms_providers => \@providers, >+ sms_provider_id => $patron->sms_provider_id ); > } > > my $new_session_id = $query->cookie('CGISESSID'); >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20439
:
137579
|
137590
|
137786
|
137800