From b148989b3b0dc96dcfd4e5a4f1e5a4243e14ff97 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 14 Feb 2020 09:48:48 +0100 Subject: [PATCH] Bug 15352: Do not display the link if item.uri does not exist Otherwise there is a "Link to ressource" that points to the current url --- koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 4 +++- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 90a8df5dc7..4ab9a27c8a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -406,8 +406,10 @@ Note that permanent location is a code, and location may be an authval. [% IF ( itemdata_uri ) %] [% IF Koha.Preference('URLLinkText') %] [% Koha.Preference('URLLinkText') %] - [% ELSE %] + [% ELSIF item.uri %] Link to resource + [% ELSE %] + [% END %] [% END %] [% IF ( itemdata_copynumber ) %] 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 04ed3f0dc3..8c1c39e8f5 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -1349,13 +1349,13 @@ [% IF trackclicks == 'track' || trackclicks == 'anonymous' %] [% IF Koha.Preference("OPACURLOpenInNewWindow") %] [% Koha.Preference('URLLinkText') | html %] - [% ELSE %] + [% ELSIF ITEM_RESULT.uri %] [% Koha.Preference('URLLinkText') | html %] [% END %] [% ELSE %] [% IF Koha.Preference("OPACURLOpenInNewWindow") %] [% Koha.Preference('URLLinkText') | html %] - [% ELSE %] + [% ELSIF ITEM_RESULT.uri %] [% Koha.Preference('URLLinkText') | html %] [% END %] [% END %] @@ -1363,13 +1363,13 @@ [% IF trackclicks == 'track' || trackclicks == 'anonymous' %] [% IF Koha.Preference("OPACURLOpenInNewWindow") %] Link to resource - [% ELSE %] + [% ELSIF ITEM_RESULT.uri %] Link to resource [% END %] [% ELSE %] [% IF Koha.Preference("OPACURLOpenInNewWindow") %] Link to resource - [% ELSE %] + [% ELSIF ITEM_RESULT.uri %] Link to resource [% END %] [% END %] -- 2.11.0