From 6904ea0eec4c0f367513e37455470a43825e92e3 Mon Sep 17 00:00:00 2001
From: Julian Maurice <julian.maurice@biblibre.com>
Date: Fri, 2 Sep 2016 15:49:22 +0200
Subject: [PATCH] Bug 8995: Remove useless code

OpenURL link display is done in XSLT only, so this code is now useless
---
 opac/opac-detail.pl | 14 --------------
 opac/opac-search.pl |  6 +-----
 2 files changed, 1 insertion(+), 19 deletions(-)

diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl
index b08e87f071..f2c2f6fe6a 100755
--- a/opac/opac-detail.pl
+++ b/opac/opac-detail.pl
@@ -1191,18 +1191,4 @@ $template->param(
     'OpacLocationBranchToDisplayShelving' => C4::Context->preference('OpacLocationBranchToDisplayShelving'),
 );
 
-# OpenURL
-if (C4::Context->preference('OPACShowOpenURL')) {
-    my ($biblio) = GetBiblioItemByBiblioNumber($biblionumber);
-    my @itypes = split( /\s/, C4::Context->preference('OPACOpenURLItemTypes') );
-    if (grep /^$biblio->{itemtype}$/, @itypes) {
-        $template->param(
-            OPACShowOpenURL => 1,
-            OpenURLResolverURL => C4::Context->preference('OpenURLResolverURL'),
-            OpenURLText => C4::Context->preference('OpenURLText'),
-            OpenURLImageLocation => C4::Context->preference('OpenURLImageLocation')
-        );
-    }
-}
-
 output_html_with_http_headers $query, $cookie, $template->output;
diff --git a/opac/opac-search.pl b/opac/opac-search.pl
index eede42ebd3..fd61549d41 100755
--- a/opac/opac-search.pl
+++ b/opac/opac-search.pl
@@ -668,11 +668,7 @@ for (my $i=0;$i<@servers;$i++) {
                 $res->{'incart'} = 1;
             }
 
-            if (C4::Context->preference('COinSinOPACResults')
-            or C4::Context->preference('OPACShowOpenURL')) {
-                if (grep /^$res->{itemtype}$/, @OpenURL_itypes) {
-                    $res->{ShowOpenURL} = 1;
-                }
+            if (C4::Context->preference('COinSinOPACResults')) {
                 my $record = GetMarcBiblio($res->{'biblionumber'});
                 $res->{coins} = GetCOinSBiblio($record);
             }
-- 
2.11.0