Bug 29230: Add Koha::Patron->messages
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Thu, 21 Oct 2021 07:57:38 +0000 (09:57 +0200)
committerKyle Hall <kyle@bywatersolutions.com>
Fri, 11 Feb 2022 11:58:35 +0000 (06:58 -0500)
commit7eca41c2a2cccba2ef8ae3a5ff8d6b04d2924e11
treec67d1df73d542ae19468ad95fafaee8761408d0d
parent30b9270bd9dfd773821d5ca17c924e8f7b56c45c
Bug 29230: Add Koha::Patron->messages

Add methods to return the messages attached to a patron.

It will add the capability to access them from notice templates.

Test plan:
Define some messages for a given patron
Go to the circulation page of the patron and confirm that they are still
displayed

Test the notice templates:
Add to HOLD_SLIP the following content
"""
[% SET messages = borrower.messages %]
[% IF messages.count %]
Messages:
<ul>
  [% FOR m IN messages.search( message_type => 'L' ) %]
    <li>[% m.message %]</li>
  [% END %]
</ul>
[% END %]
"""

To display all the messages from staff ('L')

Adapt following your needs.

Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Stina Hallin <stina.hallin@ub.lu.se>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/Patron.pm
circ/circulation.pl
t/db_dependent/Koha/Patron.t