Bugzilla – Attachment 155358 Details for
Bug 30295
Send a notification when a recall is manually cancelled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30295: Use blessed patron to enqueue notice and QA fixes
Bug-30295-Use-blessed-patron-to-enqueue-notice-and.patch (text/plain), 6.89 KB, created by
ByWater Sandboxes
on 2023-09-08 06:53:56 UTC
(
hide
)
Description:
Bug 30295: Use blessed patron to enqueue notice and QA fixes
Filename:
MIME Type:
Creator:
ByWater Sandboxes
Created:
2023-09-08 06:53:56 UTC
Size:
6.89 KB
patch
obsolete
>From d5e3deebb2c95d692d9870c901b25bed8c68cc5b Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Thu, 7 Sep 2023 23:10:09 +0000 >Subject: [PATCH] Bug 30295: Use blessed patron to enqueue notice and QA fixes > >Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se> >--- > Koha/Recall.pm | 23 ++++++++++--------- > ...RECALL_MANUAL_CANCEL_message_attributes.pl | 10 ++++---- > ...RECALL_MANUAL_CANCEL_message_transports.pl | 10 ++++---- > ...g_30295-add_RECALL_MANUAL_CANCEL_notice.pl | 12 ++++++---- > 4 files changed, 31 insertions(+), 24 deletions(-) > mode change 100644 => 100755 installer/data/mysql/atomicupdate/bug_30295-add_RECALL_MANUAL_CANCEL_message_attributes.pl > mode change 100644 => 100755 installer/data/mysql/atomicupdate/bug_30295-add_RECALL_MANUAL_CANCEL_message_transports.pl > mode change 100644 => 100755 installer/data/mysql/atomicupdate/bug_30295-add_RECALL_MANUAL_CANCEL_notice.pl > >diff --git a/Koha/Recall.pm b/Koha/Recall.pm >index 35978a1368..337dd94274 100644 >--- a/Koha/Recall.pm >+++ b/Koha/Recall.pm >@@ -456,24 +456,25 @@ sub set_cancelled { > > # send notice to recaller to pick up item > my $letter = C4::Letters::GetPreparedLetter( >- module => 'circulation', >+ module => 'circulation', > letter_code => 'RECALL_MANUAL_CANCEL', >- branchcode => $self->pickup_library_id, >- lang => $self->patron->lang, >- tables => { >- biblio => $self->biblio_id, >+ branchcode => $self->pickup_library_id, >+ lang => $self->patron->lang, >+ tables => { >+ biblio => $self->biblio_id, > borrowers => $self->patron_id, >- branches => $self->pickup_library_id, >+ branches => $self->pickup_library_id, > }, > ); > >- my $messaging_preferences = C4::Members::Messaging::GetMessagingPreferences({ borrowernumber => $self->patron_id, message_name => 'Recall_Cancelled' }); >+ my $messaging_preferences = C4::Members::Messaging::GetMessagingPreferences( >+ { borrowernumber => $self->patron_id, message_name => 'Recall_Cancelled' } ); > while ( my ( $transport, $letter_code ) = each %{ $messaging_preferences->{transports} } ) { >- if ( $transport eq 'email' ){ >- C4::Message->enqueue($letter, $self->patron->unblessed, 'email'); >+ if ( $transport eq 'email' ) { >+ C4::Message->enqueue( $letter, $self->patron, 'email' ); > } >- if ( $transport eq 'sms' ){ >- C4::Message->enqueue($letter, $self->patron->unblessed, 'sms'); >+ if ( $transport eq 'sms' ) { >+ C4::Message->enqueue( $letter, $self->patron, 'sms' ); > } > } > >diff --git a/installer/data/mysql/atomicupdate/bug_30295-add_RECALL_MANUAL_CANCEL_message_attributes.pl b/installer/data/mysql/atomicupdate/bug_30295-add_RECALL_MANUAL_CANCEL_message_attributes.pl >old mode 100644 >new mode 100755 >index 59fc9175b5..2bf5ae2031 >--- a/installer/data/mysql/atomicupdate/bug_30295-add_RECALL_MANUAL_CANCEL_message_attributes.pl >+++ b/installer/data/mysql/atomicupdate/bug_30295-add_RECALL_MANUAL_CANCEL_message_attributes.pl >@@ -1,12 +1,14 @@ > use Modern::Perl; > > return { >- bug_number => "30295", >+ bug_number => "30295", > description => "Adding message attributes for RECALL_MANUAL_CANCEL", >- up => sub { >+ up => sub { > my ($args) = @_; >- my ($dbh, $out) = @$args{qw(dbh out)}; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; > >- $dbh->do(q{ INSERT IGNORE INTO message_attributes (message_attribute_id, message_name, takes_days) VALUES (14, 'Recall_Cancelled', 0) }); >+ $dbh->do( >+ q{ INSERT IGNORE INTO message_attributes (message_attribute_id, message_name, takes_days) VALUES (14, 'Recall_Cancelled', 0) } >+ ); > }, > }; >diff --git a/installer/data/mysql/atomicupdate/bug_30295-add_RECALL_MANUAL_CANCEL_message_transports.pl b/installer/data/mysql/atomicupdate/bug_30295-add_RECALL_MANUAL_CANCEL_message_transports.pl >old mode 100644 >new mode 100755 >index e80b199735..267d5e1622 >--- a/installer/data/mysql/atomicupdate/bug_30295-add_RECALL_MANUAL_CANCEL_message_transports.pl >+++ b/installer/data/mysql/atomicupdate/bug_30295-add_RECALL_MANUAL_CANCEL_message_transports.pl >@@ -1,12 +1,14 @@ > use Modern::Perl; > > return { >- bug_number => "30295", >+ bug_number => "30295", > description => "Adding message transports for RECALL_MANUAL_CANCEL notice", >- up => sub { >+ up => sub { > my ($args) = @_; >- my ($dbh, $out) = @$args{qw(dbh out)}; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; > >- $dbh->do(q{ INSERT IGNORE INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code, branchcode) VALUES (14, "email", 0, "circulation", "RECALL_MANUAL_CANCEL", null), (14, "sms", 0, "circulation", "RECALL_MANUAL_CANCEL", null) }); >+ $dbh->do( >+ q{ INSERT IGNORE INTO message_transports (message_attribute_id, message_transport_type, is_digest, letter_module, letter_code, branchcode) VALUES (14, "email", 0, "circulation", "RECALL_MANUAL_CANCEL", null), (14, "sms", 0, "circulation", "RECALL_MANUAL_CANCEL", null) } >+ ); > }, > }; >diff --git a/installer/data/mysql/atomicupdate/bug_30295-add_RECALL_MANUAL_CANCEL_notice.pl b/installer/data/mysql/atomicupdate/bug_30295-add_RECALL_MANUAL_CANCEL_notice.pl >old mode 100644 >new mode 100755 >index 46e0882883..d9fb2f9d64 >--- a/installer/data/mysql/atomicupdate/bug_30295-add_RECALL_MANUAL_CANCEL_notice.pl >+++ b/installer/data/mysql/atomicupdate/bug_30295-add_RECALL_MANUAL_CANCEL_notice.pl >@@ -1,13 +1,14 @@ > use Modern::Perl; > > return { >- bug_number => "30295", >+ bug_number => "30295", > description => "Add RECALL_MANUAL_CANCEL email and sms notice", >- up => sub { >+ up => sub { > my ($args) = @_; >- my ($dbh, $out) = @$args{qw(dbh out)}; >+ my ( $dbh, $out ) = @$args{qw(dbh out)}; > >- $dbh->do(q{ INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES ('circulation','RECALL_MANUAL_CANCEL','','Recall has been cancelled','0','Recall has been cancelled','Dear [% borrower.firstname %] [% borrower.surname %], >+ $dbh->do( >+ q{ INSERT IGNORE INTO `letter` (`module`, `code`, `branchcode`, `name`, `is_html`, `title`, `content`, `message_transport_type`) VALUES ('circulation','RECALL_MANUAL_CANCEL','','Recall has been cancelled','0','Recall has been cancelled','Dear [% borrower.firstname %] [% borrower.surname %], > > We regret to inform you that the item you have recalled cannot be provided. Your recall was cancelled. > >@@ -19,6 +20,7 @@ We regret to inform you that the item you have recalled cannot be provided. Your > > Title: [% biblio.title %] > Author: [% biblio.author %] >-Location: [% branch.branchname %]','email') }); >+Location: [% branch.branchname %]','email') } >+ ); > }, > }; >-- >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 30295
:
131763
|
140243
|
140245
|
147108
|
148114
|
149127
|
150431
|
155347
|
155358
|
158699
|
158700
|
158701
|
159007
|
159008
|
159009
|
172038
|
172039
|
172041