Bug 23612: If no columns in a table can be toggled, don't show columns button
authorOwen Leonard <oleonard@myacpl.org>
Fri, 13 Sep 2019 18:10:25 +0000 (18:10 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 3 Oct 2019 09:45:46 +0000 (10:45 +0100)
commitdca51f46aa127fcce439561656da5606dc72e4f8
treefe77f0e5bf6dd7b68735462aeb61662027b0f31e
parent660a5b6ebc4eb35bfcca54ef3bde5e00c304c446
Bug 23612: If no columns in a table can be toggled, don't show columns button

This patch makes a change to the JavaScript setup for DataTables button
controls so that if there are no toggle-able buttons (or there is no
columns configuration at all) the column selection menu button will not
appear.

To test, apply the patch and go to Administration -> Columns settings.

 - In the Administration section, find the section for the "libraries"
   table.
 - In the "Cannot be toggled" column, check all the checkboxes.
 - Save.
 - Go to Administration -> Libraries.
 - At the top of the table there should be no "Columns" button, only
   "Clear filter" and "Export" buttons.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc