Bugzilla – Attachment 178678 Details for
Bug 21781
message_transport_type should allow fallbacks
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 21781: (follow-up) Use SMS templates
Bug-21781-follow-up-Use-SMS-templates.patch (text/plain), 5.72 KB, created by
Martin Renvoize (ashimema)
on 2025-02-25 13:04:09 UTC
(
hide
)
Description:
Bug 21781: (follow-up) Use SMS templates
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-02-25 13:04:09 UTC
Size:
5.72 KB
patch
obsolete
>From 2ffed3e207110e27d470439865ba6c3ef5313ff3 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 27 Jun 2024 15:50:13 +0100 >Subject: [PATCH] Bug 21781: (follow-up) Use SMS templates > >We shouldn't only be changing the message transport type for the enqueue >function but also for the call to GetPreparedLetter.. otherwise we'll >just be putting what may be an innapropriately formatted for email >notice into an SMS message. > >This patch updates all the occurences touched by the patchset to use the >SMS notice template when we're falling back to SMS for transport medium. > >We also drop the fallback for the expiry notice, as a bug has since >introduced functionality to send to both email and sms for that notice. >--- > C4/Acquisition.pm | 14 ++++++++------ > circ/pendingreserves.pl | 14 ++++++++------ > opac/opac-shareshelf.pl | 16 +++++++++------- > 3 files changed, 25 insertions(+), 19 deletions(-) > >diff --git a/C4/Acquisition.pm b/C4/Acquisition.pm >index 3dadeab028e..68eef8ded63 100644 >--- a/C4/Acquisition.pm >+++ b/C4/Acquisition.pm >@@ -2915,12 +2915,14 @@ sub NotifyOrderUsers { > my $patron = Koha::Patrons->find($borrowernumber); > my $library = $patron->library->unblessed; > my $biblio = Koha::Biblios->find( $order->{biblionumber} )->unblessed; >+ my $mtt = $patron->message_transport_type_for('email'); > my $letter = C4::Letters::GetPreparedLetter( >- module => 'acquisition', >- letter_code => 'ACQ_NOTIF_ON_RECEIV', >- branchcode => $library->{branchcode}, >- lang => $patron->lang, >- tables => { >+ module => 'acquisition', >+ letter_code => 'ACQ_NOTIF_ON_RECEIV', >+ branchcode => $library->{branchcode}, >+ message_transport_type => $mtt, >+ lang => $patron->lang, >+ tables => { > 'branches' => $library, > 'borrowers' => $patron->unblessed, > 'biblio' => $biblio, >@@ -2933,7 +2935,7 @@ sub NotifyOrderUsers { > letter => $letter, > borrowernumber => $borrowernumber, > LibraryName => C4::Context->preference("LibraryName"), >- message_transport_type => $patron->message_transport_type_for('email'), >+ message_transport_type => $mtt, > } > ) or warn "can't enqueue letter $letter"; > } >diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl >index a80762c3120..69bc0c000a1 100755 >--- a/circ/pendingreserves.pl >+++ b/circ/pendingreserves.pl >@@ -69,12 +69,14 @@ if ( $op eq 'cud-cancel_reserve' and $reserve_id ) { > and C4::Context->preference('CanMarkHoldsToPullAsLost') eq 'allow_and_notify' ) > { > my $library = $hold->branch; >+ my $mtt = $patron->message_transport_type_for('email'); > my $letter = C4::Letters::GetPreparedLetter( >- module => 'reserves', >- letter_code => 'CANCEL_HOLD_ON_LOST', >- branchcode => $patron->branchcode, >- lang => $patron->lang, >- tables => { >+ module => 'reserves', >+ letter_code => 'CANCEL_HOLD_ON_LOST', >+ branchcode => $patron->branchcode, >+ message_transport_type => $mtt, >+ lang => $patron->lang, >+ tables => { > branches => $library->branchcode, > borrowers => $patron->borrowernumber, > items => $item->itemnumber, >@@ -90,7 +92,7 @@ if ( $op eq 'cud-cancel_reserve' and $reserve_id ) { > { > letter => $letter, > borrowernumber => $patron->borrowernumber, >- message_transport_type => $patron->message_transport_type_for('email'), >+ message_transport_type => $mtt, > from_address => $from_address, > } > ); >diff --git a/opac/opac-shareshelf.pl b/opac/opac-shareshelf.pl >index faa1d0cff5c..ca4301879d5 100755 >--- a/opac/opac-shareshelf.pl >+++ b/opac/opac-shareshelf.pl >@@ -195,13 +195,15 @@ sub notify_owner { > my $toaddr = $patron->notice_email_address or return; > > #prepare letter >+ my $mtt = $patron->message_transport_type_for('email'); > my $letter = C4::Letters::GetPreparedLetter( >- module => 'lists', >- letter_code => 'SHARE_ACCEPT', >- branchcode => C4::Context->userenv->{"branch"}, >- lang => $patron->lang, >- tables => { borrowers => $loggedinuser, }, >- substitute => { listname => $param->{shelfname}, }, >+ module => 'lists', >+ letter_code => 'SHARE_ACCEPT', >+ branchcode => C4::Context->userenv->{"branch"}, >+ message_transport_type => $mtt, >+ lang => $patron->lang, >+ tables => { borrowers => $loggedinuser, }, >+ substitute => { listname => $param->{shelfname}, }, > ); > > #send letter to queue >@@ -210,7 +212,7 @@ sub notify_owner { > letter => $letter, > message_transport_type => 'email', > from_address => C4::Context->preference('KohaAdminEmailAddress'), >- message_transport_type => $patron->message_transport_type_for('email'), >+ message_transport_type => $mtt, > } > ); > } >-- >2.48.1
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 21781
:
103525
|
103526
|
105328
|
109559
|
124868
|
124869
|
168199
|
168200
|
168201
|
178677
| 178678