From 829d193a1aee8492336c300b2314473420f7bb80 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 8 Jan 2021 12:10:22 +0100 Subject: [PATCH] Bug 27402: Add DT column filtering to the cities admin page Bug 24561 added a wrapper to use easily all the DataTables functionalities when a REST API route was used within Koha. The filtering method used is working for the global search filter, but not if we have a filter on top of each column. This patchset is going to, first, add the filters on top of each column of the cities table, then the code will be moved to the DT REST API wrapper to make it reusable easily. Test plan: Generate some cities: use Koha::Cities; for ( 1 .. 42 ) { Koha::City->new({city_name => "name_$_", city_state => "state_$_", city_country => "country_$_", city_zipcode => "zipcode_$_" })->store; } Hit /admin/cities.pl Use the filters The general filter must do a OR query on each of the cities' attributes, when column filters must use AND Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart --- .../prog/en/modules/admin/cities.tt | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt index 618e757773..3ea36ed876 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/cities.tt @@ -134,6 +134,7 @@ [% END %] [% IF cities_count > 0 %] +
@@ -167,8 +168,10 @@ [% Asset.js("js/admin-menu.js") | $raw %] [% INCLUDE 'datatables.inc' %] [% END %] -- 2.39.5