From 53019cf8eeb20601b51e22b33f89f79d55cab767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?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 --- Koha/Template/Plugin/ColumnsSettings.pm | 11 +++++++++++ koha-tmpl/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 f0a63c50ec..d68e9b5717 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', 'item_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', 'item_materials') %] [% ITEM_RESULT.materials | html %] [% END %] [% IF ( itemdata_enumchron ) %] -- 2.11.0