From 1731c97236d77d3eba72a8720549415ad1501c53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nazl=C4=B1=20=C3=87etin?= Date: Fri, 27 Mar 2020 15:20:40 +0000 Subject: [PATCH] Bug 13547: (follow-up) Item field 'Materials specified' would be useful to see in OPAC --- Koha/Template/Plugin/ColumnsSettings.pm | 12 ++++++++++++ koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/Koha/Template/Plugin/ColumnsSettings.pm b/Koha/Template/Plugin/ColumnsSettings.pm index 4617969d3af..e271b8caca9 100644 --- a/Koha/Template/Plugin/ColumnsSettings.pm +++ b/Koha/Template/Plugin/ColumnsSettings.pm @@ -52,4 +52,16 @@ 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 e1c0420218f..7866d149b3a 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1137,7 +1137,7 @@ [% IF ( Koha.Preference('OpacLocationOnDetail') == 'column' && itemdata_location ) %] Shelving location[% END %] Call number - [% IF ( itemdata_materials ) %] + [% UNLESS ColumnsSettings.is_hidden( 'opac', 'biblio-detail', 'holdingst', 'itemdata_materials' ) %] Materials specified[% END %] [% IF ( itemdata_enumchron ) %] Vol info[% END %] @@ -1241,7 +1241,7 @@ [% END %] [% END %] - [% IF ( itemdata_materials) %] + [% UNLESS ColumnsSettings.is_hidden( 'opac', 'biblio-detail', 'holdingst', 'itemdata_materials') %] [% ITEM_RESULT.materials | html %] [% END %] [% IF ( itemdata_enumchron ) %] -- 2.11.0