From 363f20e1fae3db1f317ce0540168e8f47cf22871 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=UTF-8 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 --- C4/Utils/DataTables/ColumnsSettings.pm | 13 ++++++++++++- .../prog/en/includes/columns_settings.inc | 18 ++++++++++++------ .../intranet-tmpl/prog/en/includes/datatables.inc | 2 ++ koha-tmpl/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 eb0ca54..6a804c4 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 ec86690..7d80435 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 %] - - + + + + +