From 0cd8746c62d9988f88da246ce15a159c77a6d5b5 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. --- circ/returns.pl | 10 +++++++++- koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt | 8 ++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/circ/returns.pl b/circ/returns.pl index 116ac3c15e..7f9c35f696 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -56,6 +56,7 @@ use Koha::DateUtils; use Koha::Holds; use Koha::Items; use Koha::Patrons; +use Koha::Patron::Messages; my $query = CGI->new; @@ -576,12 +577,19 @@ foreach ( sort { $a <=> $b } keys %returneditems ) { $ri{minute} = $duedate->minute(); $ri{duedate} = output_pref($duedate); my $patron = Koha::Patrons->find( $riborrowernumber{$_} ); + my $patron_messages = Koha::Patron::Messages->search( + { + borrowernumber => $riborrowernumber{$_}, + message_type => 'B', + }); + unless ( $dropboxmode ) { $ri{return_overdue} = 1 if (DateTime->compare($duedate, dt_from_string()) == -1); } else { $ri{return_overdue} = 1 if (DateTime->compare($duedate, $dropboxdate) == -1); } - $ri{patron} = $patron, + $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 4ebc4cd40f..6e4100c1ca 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt @@ -916,6 +916,14 @@ [% IF ( riloo.patron.borrowernotes ) %]

[% riloo.patron.borrowernotes | html %]

[% 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.11.0