Bugzilla – Attachment 166364 Details for
Bug 33260
Show message queue on staff interface and make notices printable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33260: Add a patron getter method to Koha::Notice::Message
Bug-33260-Add-a-patron-getter-method-to-KohaNotice.patch (text/plain), 2.25 KB, created by
Martin Renvoize
on 2024-05-08 09:45:22 UTC
(
hide
)
Description:
Bug 33260: Add a patron getter method to Koha::Notice::Message
Filename:
MIME Type:
Creator:
Martin Renvoize
Created:
2024-05-08 09:45:22 UTC
Size:
2.25 KB
patch
obsolete
>From 1105b1d9eee3a06a83ff9f816c5823d24cd07294 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Tue, 21 Mar 2023 02:47:29 +0000 >Subject: [PATCH] Bug 33260: Add a patron getter method to > Koha::Notice::Message > >Signed-off-by: Laura Escamilla <laura.escamilla@bywatersolutions.com> >Signed-off-by: kelly <kelly@bywatersolutions.com> >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > Koha/Notice/Message.pm | 16 ++++++++++++++++ > t/db_dependent/Letters.t | 8 +++++--- > 2 files changed, 21 insertions(+), 3 deletions(-) > >diff --git a/Koha/Notice/Message.pm b/Koha/Notice/Message.pm >index 694ff0a0b0c..2146e1a6d31 100644 >--- a/Koha/Notice/Message.pm >+++ b/Koha/Notice/Message.pm >@@ -88,6 +88,22 @@ EOS > return $wrapped; > } > >+=head3 patron >+ >+ my $patron = $message->patron; >+ >+Returns the Koha::Patron object for the recipient of the queued message >+ >+=cut >+ >+sub patron { >+ my ($self) = @_; >+ >+ $self->{_patron} ||= Koha::Patrons->find( $self->borrowernumber ); >+ >+ return $self->{_patron}; >+} >+ > =head3 type > > =cut >diff --git a/t/db_dependent/Letters.t b/t/db_dependent/Letters.t >index 8ae4bcd3e24..d61d3be01ce 100755 >--- a/t/db_dependent/Letters.t >+++ b/t/db_dependent/Letters.t >@@ -18,7 +18,7 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > use Modern::Perl; >-use Test::More tests => 100; >+use Test::More tests => 101; > use Test::MockModule; > use Test::Warn; > use Test::Exception; >@@ -154,8 +154,10 @@ is( $messages->[0]->{updated_on}, $messages->[0]->{time_queued}, 'Time status ch > is( $messages->[0]->{failure_code}, '', 'Failure code for successful message correctly empty'); > > # Setting time_queued to something else than now >-my $yesterday = dt_from_string->subtract( days => 1 ); >-Koha::Notice::Messages->find($messages->[0]->{message_id})->time_queued($yesterday)->store; >+my $yesterday = dt_from_string->subtract( days => 1 ); >+my $message_obj = Koha::Notice::Messages->find( $messages->[0]->{message_id} )->time_queued($yesterday)->store; >+my $patron_obj = Koha::Patrons->find($borrowernumber); >+is_deeply( $message_obj->patron, $patron_obj, "Koha::Notice::Message->patron sub correctly returns patron object" ); > > # SendQueuedMessages > >-- >2.45.0
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 33260
:
148437
|
148438
|
148439
|
148440
|
148943
|
149009
|
149413
|
149581
|
149593
|
149594
|
149595
|
149596
|
149597
|
149598
|
150346
|
150347
|
154927
|
154928
|
157383
|
157384
|
157385
|
157386
|
158852
|
158853
|
158854
|
158855
|
162570
|
162571
|
162572
|
162573
|
162574
|
162624
|
162625
|
162677
|
162678
|
162679
|
162680
|
162681
|
164783
|
164784
|
164785
|
164786
|
164787
|
165238
|
165239
|
165717
|
165939
|
165946
|
165947
|
165948
|
165949
|
165950
|
165951
|
166020
|
166178
|
166335
|
166336
|
166337
|
166338
|
166339
|
166340
|
166341
|
166342
|
166343
|
166344
|
166345
|
166362
|
166363
| 166364 |
166365
|
166366
|
166367
|
166368
|
166369
|
166370
|
166371
|
166372
|
166373