From 80df01b4e53c7784729aff36e2bb6e509e28b86f Mon Sep 17 00:00:00 2001 From: Emily Lamancusa Date: Wed, 16 Jul 2025 10:10:21 -0400 Subject: [PATCH] Bug 40367: Improve display of messages on patron account When displaying messages on a patron account, group the messages by type and label which are OPAC messages and which are internal staff messages. To test: 1. Find a patron and add several messages to their account, alternating between internal staff messages and OPAC messages --> Note that the messages display in the order that they are added and not explicitly labeled 2. Apply patch and refresh page --> Confirm that all staff messages display first and all OPAC messages display underneath --> Confirm that messages are now labeled "Staff note" or "OPAC" 3. Play around on the patron account and confirm that the message display is consistent after taking different actions: - On the Details page - On the Check out page - After adding a new staff message - After adding a new OPAC message --- circ/circulation.pl | 7 ++++--- .../intranet-tmpl/prog/en/includes/patron_messages.inc | 3 +++ members/moremember.pl | 7 ++++--- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/circ/circulation.pl b/circ/circulation.pl index 5d432b4f80..132c947f8d 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -695,9 +695,10 @@ if ($patron) { my $patron_messages = $patron->messages->search( {}, { - join => 'manager', - '+select' => [ 'manager.surname', 'manager.firstname' ], - '+as' => [ 'manager_surname', 'manager_firstname' ], + join => 'manager', + '+select' => [ 'manager.surname', 'manager.firstname' ], + '+as' => [ 'manager_surname', 'manager_firstname' ], + 'order_by' => { -desc => 'me.message_type' }, } ); $template->param( patron_messages => $patron_messages ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc index 942993dde7..25e05462e9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron_messages.inc @@ -327,12 +327,15 @@ [% FOREACH patron_message IN patron_messages %]
  • [% SET span_class = '' %] + [% SET msg_type = 'OPAC' %] [% IF(patron_message.message_type == "L") %] [% span_class = 'circ-hlt' %] + [% msg_type = 'Staff note' %] [% END %] [% patron_message.message_date | $KohaDates %] [% Branches.GetName( patron_message.branchcode ) | html %] + - [% t(msg_type) | html %] [% IF patron_message.manager_id %] ( search( 'me.borrowernumber' => $patron->borrowernumber, }, { - join => 'manager', - '+select' => [ 'manager.surname', 'manager.firstname' ], - '+as' => [ 'manager_surname', 'manager_firstname' ], + join => 'manager', + '+select' => [ 'manager.surname', 'manager.firstname' ], + '+as' => [ 'manager_surname', 'manager_firstname' ], + 'order_by' => { -desc => 'me.message_type' }, } ); -- 2.39.5