Bug 9044: (follow-up) set the number of filters according to number of columns
authorJulian Maurice <julian.maurice@biblibre.com>
Mon, 30 Sep 2013 07:02:30 +0000 (09:02 +0200)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 31 Oct 2013 05:31:12 +0000 (05:31 +0000)
Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Filters now shows correctly. No errors

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
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 <gmc@esilibrary.com>
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt

index dc979da..26f945c 100644 (file)
@@ -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');