From 109d16b5bf833e5a459cca4c5f9fba2e585eea75 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 19 Nov 2024 13:38:45 +0100 Subject: [PATCH] Bug 38484: (bug 36640 follow-up) Fix filters on "Holds to pull" On "Bug 36640: Remove fnAddFilters" I assume that it was only used for debounce. But actually it was used on this table to add filtering. This patch adjusts how we deal with the filters on this table, reusing the standard "add_filters" and "filters_options" parameters of KohaTable. It also passes the DT object allowing to use DT's api. Here it is useful to retrieve the data in the column. Signed-off-by: Emily Lamancusa Signed-off-by: David Cook --- .../prog/en/modules/circ/pendingreserves.tt | 82 +++++-------------- koha-tmpl/intranet-tmpl/prog/js/datatables.js | 2 +- 2 files changed, 21 insertions(+), 63 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt index 2a53dbaac1..5c0a190a79 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/pendingreserves.tt @@ -1,4 +1,5 @@ [% USE raw %] +[% USE To %] [% USE Asset %] [% USE Koha %] [% USE KohaDates %] @@ -251,27 +252,6 @@ [% END %] - - - - - - - - - - - - - - - - - - - - - [% ELSE %] No items found. @@ -326,57 +306,35 @@ [% INCLUDE 'datatables.inc' %] [% INCLUDE 'columns_settings.inc' %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/js/datatables.js index 9813505421..b46784e1cb 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/js/datatables.js @@ -808,7 +808,7 @@ function _dt_add_filters(table_node, table_dt, filters_options = {}) { if ( !filters_options.hasOwnProperty(i) ) { filters_options[i] = eval(filter_type) } else if ( typeof filters_options[i] === "function" ) { - filters_options[i] = filters_options[i]() + filters_options[i] = filters_options[i](table_dt) } $(filters_options[i]).each(function(){ let o = $(''.format(this._id, this._str)); -- 2.39.5