From fdefd387f9e3c4fe0816f59de34bc5b3a54c6ff9 Mon Sep 17 00:00:00 2001
From: Nick Clemens <nick@bywatersolutions.com>
Date: Fri, 26 May 2023 10:58:33 +0000
Subject: [PATCH] Bug 33845: Display hold notes in staff client circulation
 paes

This patch adds the reservenotes column to svc holds, and ensures they display on
circulation and memeber details

To test:
1 - Enable system preference 'OpacHoldNotes'
2 - Place a hold for a ptron via the OPAC
3 - View the patron in the staff client
4 - Click on the 'Holds' tab
5 - Ensure you can see the hold note
6 - Click on the 'Circulation' tab on the left
7 - Click the 'Holds' tab and confirm you can view the note
---
 koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt   | 1 +
 koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt | 1 +
 koha-tmpl/intranet-tmpl/prog/js/holds.js                      | 1 +
 svc/holds                                                     | 1 +
 4 files changed, 4 insertions(+)

diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
index 6fc4e740c5..2b3c2b0893 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt
@@ -917,6 +917,7 @@
                                                 <th>Pickup at</th>
                                                 <th>Expiration</th>
                                                 <th>Priority</th>
+                                                <th>Notes</th>
                                                 <th>Cancel?</th>
                                                 <th>Suspend?</th>
                                                 <th>Status</th>
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
index 6baa7e2ace..86eee74f5c 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt
@@ -797,6 +797,7 @@
                                                         <th>Pickup at</th>
                                                         <th>Expiration</th>
                                                         <th>Priority</th>
+                                                        <th>Notes</th>
                                                         <th>Delete?</th>
                                                         <th>Suspend?</th>
                                                         <th>Status</th>
diff --git a/koha-tmpl/intranet-tmpl/prog/js/holds.js b/koha-tmpl/intranet-tmpl/prog/js/holds.js
index 0b223bf302..7cf0de410c 100644
--- a/koha-tmpl/intranet-tmpl/prog/js/holds.js
+++ b/koha-tmpl/intranet-tmpl/prog/js/holds.js
@@ -233,6 +233,7 @@ $(document).ready(function() {
                             }
                         }
                     },
+                    { "data": "reservenotes" },
                     {
                         "bSortable": false,
                         "mDataProp": function( oObj ) {
diff --git a/svc/holds b/svc/holds
index 8043297573..49888cdaf2 100755
--- a/svc/holds
+++ b/svc/holds
@@ -113,6 +113,7 @@ while ( my $h = $holds_rs->next() ) {
         waiting_at     => $h->branch()->branchname(),
         waiting_here   => $h->branch()->branchcode() eq $branch,
         priority       => $h->priority(),
+        reservenotes   => $h->reservenotes(),
         itemtype_limit => $itemtype_limit,
         reservedate_formatted => $h->reservedate() ? output_pref(
             { dt => dt_from_string( $h->reservedate() ), dateonly => 1 }
-- 
2.30.2