From 987c426301303e284742fae66ffeb777a5554bf2 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 18 Apr 2023 15:07:03 +0200 Subject: [PATCH] Bug 33568: URI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Owen Leonard Signed-off-by: Laurence Rault Signed-off-by: Emily Lamancusa Signed-off-by: Tomás Cohen Arazi --- .../prog/en/modules/catalogue/detail.tt | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) 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 fdfe0e6c112..fd35d2041cb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -2493,6 +2493,11 @@ const av_damaged = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.damaged' })) | $raw %].map( av => [av.authorised_value, av.lib])); const av_not_for_loan= new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.notforloan' })) | $raw %].map( av => [av.authorised_value, av.lib])); const av_restricted = new Map([% To.json(AuthorisedValues.GetDescriptionsByKohaField({ kohafield => 'items.restricted' })) | $raw %].map( av => [av.authorised_value, av.lib])); + [% IF Koha.Preference('URLLinkText') %] + const url_link_text = "[% Koha.Preference('URLLinkText') | html %]"; + [% ELSE %] + const url_link_text = _("Link to resource"); + [% END %] let table_url = "/api/v1/biblios/[% biblio.biblionumber | uri %]/items?"; let embed = ["+strings,checkout,checkout.patron,transfer,first_hold,first_hold.patron,item_type"]; [% IF Koha.Preference('LocalCoverImages') %] @@ -2824,7 +2829,17 @@ searchable: true, orderable: true, render: function (data, type, row, meta) { - return row.uri; // FIXME Display link + if ( !row.uri ) return ""; + + let nodes = ''; + if ( row.uri.split(' \| ').length > 1 ) { + row.uri.split(' \| ').forEach((uri, i) => { + nodes += '%s
'.format(uri, uri); + }); + } else { + nodes += '%s
'.format(row.uri, url_link_text); + } + return nodes; } }, { -- 2.34.1