From 46ba00d208241f51b6198cb3454f727c0cea5a93 Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Wed, 17 Jul 2013 15:49:11 +0200 Subject: [PATCH 1/3] Bug 7706 - use AuthorisedValueImages in opac-detail.pl The syspref AuthorisedValueImages is used to hide/show authorized value images of field of biblio in results and detail OPAC pages. This patch adds the use of this syspref in detail page. Test plan: - Select an autorized values category : ie "LANG" - Edit a value to set an image : ie "fr" - Edit a framework to define a field has using this autorized values category : ie 200$z => "LANG" - Edit a biblio with this framework to set this field with the edited autorised value : ie 200$f => "fr" - Rebuild this biblio - Set AuthorisedValueImages on - Perform a search at OPAC that returns edited biblio => The image is displayed - Set AuthorisedValueImages off - Perform a search at OPAC that returns edited biblio => The image is not displayed --- opac/opac-detail.pl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 9d0851f..69c30bf 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -521,8 +521,14 @@ foreach my $subscription (@subscriptions) { $dat->{'count'} = scalar(@items); - -my $biblio_authorised_value_images = C4::Items::get_authorised_value_images( C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) ); +if ( C4::Context->preference('AuthorisedValueImages') ) { + my $biblio_authorised_value_images = + C4::Items::get_authorised_value_images( + C4::Biblio::get_biblio_authorised_values( $biblionumber, $record ) ); + $template->param( + authorised_value_images => $biblio_authorised_value_images + ); +} my (%item_reserves, %priority); my ($show_holds_count, $show_priority); @@ -653,7 +659,6 @@ my $subtitle = GetRecordValue('subtitle', $record, GetFrameworkCode($bib itemdata_uri => $itemfields{uri}, itemdata_copynumber => $itemfields{copynumber}, itemdata_itemnotes => $itemfields{itemnotes}, - authorised_value_images => $biblio_authorised_value_images, subtitle => $subtitle, OpacStarRatings => C4::Context->preference("OpacStarRatings"), ); -- 1.7.10.4