From 2bb243bb6283b6deab82b8d7744ceb288e32e9a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nazl=C4=B1=20=C3=87etin?= Date: Fri, 27 Mar 2020 17:13:02 +0000 Subject: [PATCH] Bug 13547: (follow-up) Item field 'Materials specified' would be useful to see in OPAC Signed-off-by: Owen Leonard Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- Koha/Template/Plugin/ColumnsSettings.pm | 11 +++++++++++ .../opac-tmpl/bootstrap/en/modules/opac-detail.tt | 4 ++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Koha/Template/Plugin/ColumnsSettings.pm b/Koha/Template/Plugin/ColumnsSettings.pm index 4617969d3a..ee9febe1ce 100644 --- a/Koha/Template/Plugin/ColumnsSettings.pm +++ b/Koha/Template/Plugin/ColumnsSettings.pm @@ -52,4 +52,15 @@ sub GetColumns { : $columns } +sub is_hidden { + my ( $self, $module, $page, $table, $column_name ) = @_; + my $columns = C4::Utils::DataTables::ColumnsSettings::get_columns( $module, $page, $table ); + foreach my $keys(@$columns){ + if($keys->{'columnname'} eq $column_name){ + return $keys->{'is_hidden'}; + } + } + return 0; +} + 1; diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index f1758ac2ae..b6c926dbf1 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1143,7 +1143,7 @@ [% IF ( Koha.Preference('OpacLocationOnDetail') == 'column' && itemdata_location ) %] Shelving location[% END %] Call number - [% IF ( itemdata_materials ) %] + [% UNLESS ColumnsSettings.is_hidden( 'opac', 'biblio-detail', 'holdingst', 'item_materials') %] Materials specified[% END %] [% IF ( itemdata_enumchron ) %] Vol info[% END %] @@ -1247,7 +1247,7 @@ [% END %] [% END %] - [% IF ( itemdata_materials) %] + [% UNLESS ColumnsSettings.is_hidden( 'opac', 'biblio-detail', 'holdingst', 'item_materials') %] [% ITEM_RESULT.materials | html %] [% END %] [% IF ( itemdata_enumchron ) %] -- 2.39.5