From f7c6cd77caafacfca4f4be84b2fd04bb9202c45f Mon Sep 17 00:00:00 2001
From: Wainui Witika-Park <wainuiwitikapark@catalyst.net.nz>
Date: Tue, 18 Jul 2023 01:24:16 +0000
Subject: [PATCH] Bug 34300: Add holds column to order table
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Adds the ability to easily place a hold on an ordered item from a basket

To test:
    1) Apply patch
    2) Go to acquisitions
    3) Go to an existing basket, or create a new one
    4) Add an order to the basket
    4) Notice there is a "Place hold" column in the Orders table
    5) Click the link for an item which allows you to place a hold easily on the biblio
    6) On the columns settings, toggle the "Place hold" column to hide it, and make sure it gets hidden

    Sponsored-by: Pymble Ladies’ College

Signed-off-by: Lisette Scheer <lisette.scheer@bywatersolutions.com>
---
 admin/columns_settings.yml                              | 2 ++
 koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt | 6 ++++++
 2 files changed, 8 insertions(+)

diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml
index 12091f3154..f05cc4fd09 100644
--- a/admin/columns_settings.yml
+++ b/admin/columns_settings.yml
@@ -154,6 +154,8 @@ modules:
               columnname: estimated_delivery_date
             -
               columnname: supplier_report
+            -
+              columnname: place_hold
             -
               columnname: modify
               cannot_be_toggled: 1
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt
index e7d4cbfaa0..aabb9bdca0 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt
@@ -475,6 +475,7 @@
                                                     [% IF Koha.Preference('EDIFACT') && ediaccount %]
                                                         <th>Supplier report</th>
                                                     [% END %]
+                                                    <th>Place hold</th>
                                                     [% IF ( active ) %]
                                                         [% UNLESS ( closedate ) %]
                                                             <th class="NoSort">Modify</th>
@@ -653,6 +654,11 @@
                                                         [% IF Koha.Preference('EDIFACT') && ediaccount %]
                                                             <td>[% books_loo.suppliers_report | html %]</td>
                                                         [% END %]
+                                                        <td>
+                                                            <a href="/cgi-bin/koha/reserve/request.pl?biblionumber=[% books_loo.biblionumber | uri %]">
+                                                                Place a hold on the order
+                                                            </a>
+                                                        </td>
                                                         [% IF ( active ) %]
                                                             [% UNLESS ( closedate ) %]
                                                                 <td>
-- 
2.30.2