From 93ef24b91a1715da6fd21ac761568d470235df67 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=utf8 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 Signed-off-by: Katrin Fischer --- .../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 fdfe0e6c11..fd35d2041c 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.39.5