From a794ce5a7696542dfe10551c0ccb57a948486db5 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Mon, 30 Sep 2013 09:02:30 +0200 Subject: [PATCH] Bug 9044: (follow-up) set the number of filters according to number of columns Signed-off-by: Bernardo Gonzalez Kriegel Filters now shows correctly. No errors Signed-off-by: Katrin Fischer Passes all tests and QA script. This feature is a little controversial as it removes the batch edit/delete options from the menu and moves them to the item table, additionally controlled by a system preference. Maybe later on, we can think about the UI a bit more, but it works nicely. Tested with. - SeparateHoldings and SeparateHoldingsBranch activated/deactivated. - Search filters. - None, both, or one of the permissions. Signed-off-by: Galen Charlton --- .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index dc979da7e0..26f945c8a9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -176,11 +176,20 @@ function verify_images() { table = $("#" + id + " table"); if (table.length == 1) { filters_row = table.find('thead tr.filters_row'); + + [% IF StaffDetailItemSelection %] + var aoColumns = []; + filters_row.find('th').each(function() { + aoColumns.push('text'); + }); + aoColumns[0] = null; + [% END %] + if (table.find('thead tr.columnFilter').length == 0) { table.dataTable().columnFilter({ 'sPlaceHolder': 'head:after' [% IF StaffDetailItemSelection %] - , aoColumns: [ null, 'text', 'text', 'text', 'text', 'text', 'text', 'text' ] + , 'aoColumns': aoColumns [% END %] }); filters_row.addClass('columnFilter'); -- 2.39.5