From 9cb5a6088a4f28f208258e6979467b11441e5ce4 Mon Sep 17 00:00:00 2001 From: Matthias Meusburger Date: Tue, 5 Jan 2021 11:10:38 +0100 Subject: [PATCH] Bug 27339: Display opac notes and opac messages on check-in . Adds Opac note (borrowers.opacnote) and Opac messages (messages table) during check-in. Test plan: 1- Add an Opac note and one or several Opac messages to a patron. 2- Checkout and check-in an item for this patron. 3- Check that Opac note and Opac message(s) are not displayed on check-in. 4- Apply the patch. 5- Checkout and check-in an item for this patron. 6- Check that Opac note and Opac message(s) are displayed on check-in. Signed-off-by: Stina Hallin --- circ/returns.pl | 11 ++++++++++- .../intranet-tmpl/prog/en/modules/circ/returns.tt | 8 ++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/circ/returns.pl b/circ/returns.pl index 72e004a..97b9a67 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -53,6 +53,7 @@ use Koha::Holds; use Koha::Item::Transfers; use Koha::Items; use Koha::Patrons; +use Koha::Patron::Messages; use Koha::Recalls; my $query = CGI->new; @@ -805,7 +806,15 @@ foreach ( sort { $a <=> $b } keys %returneditems ) { } else { $ri{return_overdue} = 1 if (DateTime->compare($duedate, $dropboxdate) == -1); } - $ri{patron} = $patron, + my $patron_messages = Koha::Patron::Messages->search( + { + borrowernumber => $riborrowernumber{$_}, + message_type => 'B', + }); + + + $ri{patron} = $patron; + $ri{messages} = $patron_messages; $ri{borissuescount} = $patron->checkouts->count; } else { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt index 7091e5e..535d403 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -1363,6 +1363,14 @@ [% IF ( riloo.patron.borrowernotes ) %]

[% riloo.patron.borrowernotes | $raw | html_line_break %]

[% END %] + [% IF ( riloo.patron.opacnote ) %] +

[% riloo.patron.opacnote | html %]

+ [% END %] + [% IF ( riloo.messages.count ) %] + [% FOREACH message IN riloo.messages %] +

[% message.message | html %]

+ [% END %] + [% END %] [% IF ( riloo.itemnote ) %]

[% riloo.itemnote | html %]

[% END %] -- 2.43.0