From d7a87e2cbd25d55c2e6a47e030f14ecaa4e47ae0 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Thu, 11 Jun 2026 18:14:39 +0100 Subject: [PATCH] Bug 42443: (QA follow-up) Use library selects for Sent from and Home library filters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the free-text filter inputs for the "Sent from" and "Home library" columns with select dropdowns populated from the full library list, consistent with other DataTables pages such as the pending bookings page. The "Sent from" column is made visible again (it was previously hidden since rowGroup provides the visual grouping); showing it also allows its filter cell to render. The "On hold for" column intentionally has no filter: it is computed from two different embedded sub-objects (item.first_hold.patron or item.recall.patron) and has no single API field to filter against server-side. Signed-off-by: Martin Renvoize Signed-off-by: Tomás Cohen Arazi Signed-off-by: Pedro Amorim --- .../prog/en/modules/circ/transferstoreceive.tt | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt index cf1e7bafcd..6d9a2e2f28 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt @@ -4,6 +4,7 @@ [% USE KohaDates %] [% USE Branches %] [% USE TablesSettings %] +[% USE To %] [% PROCESS 'i18n.inc' %] [% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] @@ -53,6 +54,12 @@ var table_settings = [% TablesSettings.GetTableSettings( 'circ', 'transferstoreceive', 'transferstoreceive', 'json' ) | $raw %]; var TransfersMaxDaysWarning = [% TransfersMaxDaysWarning ? TransfersMaxDaysWarning : 0 | html %]; + var all_libraries = [% To.json(Branches.all) | $raw %].map(function (e) { + e["_id"] = e.branchcode; + e["_str"] = e.branchname; + return e; + }); + // Mirror the legacy "late transfer" calculation: a transfer is late once it has been // sent for more than TransfersMaxDaysWarning days without arriving function days_late(sent_date) { @@ -89,16 +96,14 @@ dataSrc: "from_library_id", startRender: function (rows, group) { var first = rows.data()[0]; - return first.from_library - ? escape_str(first.from_library.name) - : escape_str(group); + return first.from_library ? escape_str(first.from_library.name) : escape_str(group); }, }, - columnDefs: [{ visible: false, targets: [0] }], columns: [ { data: "me.from_library_id", title: _("Sent from"), + dataFilter: "libraries", searchable: true, orderable: false, render: function (data, type, row, meta) { @@ -171,6 +176,7 @@ { data: "item.home_library_id", title: _("Home library"), + dataFilter: "libraries", searchable: true, orderable: true, render: function (data, type, row, meta) { @@ -201,7 +207,8 @@ }, table_settings, 1, - additional_filters + additional_filters, + { libraries: all_libraries } ); $("#transferstoreceive").on("click", ".cancel-transfer", function (e) {