From 243b797dd11bc0ac1f475195ab765ffbf2220f8b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 14 Dec 2015 12:17:43 +0000 Subject: [PATCH] Bug 15285: Update common files MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch moves the Button area all tables which does not redefine the dom/sDom DT parameter. Signed-off-by: Marc Véron Signed-off-by: Kyle M Hall Signed-off-by: Brendan Gallagher brendan@bywatersolutions.com --- C4/Utils/DataTables/ColumnsSettings.pm | 13 ++++++++++++- .../prog/en/includes/columns_settings.inc | 18 ++++++++++++------ .../prog/en/includes/datatables.inc | 2 ++ .../intranet-tmpl/prog/en/js/datatables.js | 2 +- 4 files changed, 27 insertions(+), 8 deletions(-) diff --git a/C4/Utils/DataTables/ColumnsSettings.pm b/C4/Utils/DataTables/ColumnsSettings.pm index eb0ca54505..6a804c43a4 100644 --- a/C4/Utils/DataTables/ColumnsSettings.pm +++ b/C4/Utils/DataTables/ColumnsSettings.pm @@ -44,7 +44,18 @@ sub get_columns { $column->{cannot_be_toggled} = $c->cannot_be_toggled; } - return $list->{modules}{$module}{$page}{$tablename} || []; + my $columns = $list->{modules}{$module}{$page}{$tablename} || []; + + # Assign default value if does not exist + $columns = [ map { + { + cannot_be_toggled => exists $_->{cannot_be_toggled} ? $_->{cannot_be_toggled} : 0, + is_hidden => exists $_->{is_hidden} ? $_->{is_hidden} : 0, + columnname => $_->{columnname}, + } + } @$columns ]; + + return $columns; } sub get_modules { diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc index ec86690195..7d80435577 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/columns_settings.inc @@ -1,13 +1,14 @@ [% USE ColumnsSettings %] - - + + + + +