From 034ab4732172e3db61174bf441e17d00eb6e85f9 Mon Sep 17 00:00:00 2001 From: Alexander Wagner Date: Fri, 6 Mar 2026 12:18:26 +0000 Subject: [PATCH] Bug 38425: Add external links based on PIDs Render some (common) persistent identifiers from field 024 (Marc21) or field 017 (UNIMARC) as links to external resources. To this end evaluate `$2` and the appropriate resolver URL. Currently implemented values for `$2`: arXiv, doi, inspire, openlibrary, pmc, pmid, handle. Test plan: 1. Open intranet interface and edit any record 2. Add PIDs to your records. For Marc21 use `024 7_` for UNIMARC use `017 7_` with the following subfield layout: - $2 doi $a 10.1103/grxd-71sk - $2 doi $a 10.3204/PUBDB-2025-05454 - $2 pmid $a 29942120 - $2 pmc $a PMC6005330 - $2 arxiv $a arxiv:2411.05889 - $2 inspire $a 2835154 - $2 openlibrary $a OL27448W - $2 hdl $a 2128/34598 (May be all or any combination. The values of $a would not matter, the above just gives valid links to the external system in question.) 3. Check intranet detail display of the record: nothing appears 4. Check OPAC detail display of the record: nothing appears 5. Apply the patch 6. Check intranet detail display of the record. Depending on the PIDs in the record lines for each type get added, if a PID does not exist no line is added, values in 024/017 that are not handled are ignored and do not trigger any output. Each line gives the type of the PID in front and separated list of all ids of this type expressed as clickable links in line with the usual display of Koha. E.g. ``` DOI: 10.1103/grxd-71sk | 10.3204/PUBDB-2025-05454 PMID: 29942120 ``` 7. Check OPAC detail display of the record. It will show a similar list of ids clickable and resolving to the appropriate exteral system. Technical notes: - The whole section of links crated is encapsulated in `` - Each line of a given PID group (e.g. doi) is encapsulated in `` where the last term gives the type of the id in question - The individual elements of the generated `
    ` are expressed as `
  • ` to allow for styling (incl. supression) via CSS. Sponsored-by: Deutsches Elektronen-Synchrotron DESY, Library Signed-off-by: Alexander Wagner --- .../prog/css/src/staff-global.scss | 21 --- .../en/xslt/MARC21slim2intranetDetail.xsl | 156 +++++++++-------- .../en/xslt/UNIMARCslim2intranetDetail.xsl | 160 ++++++++--------- .../en/xslt/MARC21slim2OPACDetail.xsl | 155 +++++++++-------- .../en/xslt/UNIMARCslim2OPACDetail.xsl | 163 +++++++++--------- 5 files changed, 324 insertions(+), 331 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index aa8bcd31bb..032f4a8ad7 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -5159,24 +5159,3 @@ div .suggestion_note { text-align: left; } */ -// Repeatable fields display (Bug 30148) -.resource_list { - display: inline-block; - margin: 0; - padding-left: 0; - - li { - display: inline-block; - white-space: nowrap; - - &::after { - content: " | "; - } - - &:last-child { - &::after { - content: ""; - } - } - } -} diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl index da08dd115d..1e5dcca652 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl @@ -15,6 +15,7 @@ + @@ -961,83 +962,58 @@ - + - External resource(s): - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2024,6 +2000,34 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl index 0ca1f18524..7d09a8bf23 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/UNIMARCslim2intranetDetail.xsl @@ -25,85 +25,60 @@ - - - External resource(s): - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -589,4 +564,31 @@ + + + + + + + + + + + + + + + + + + + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl index b20333a818..6b1b920ae4 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl @@ -1064,83 +1064,58 @@ - + - External resource(s): - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2289,4 +2264,32 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl index 55abf2adc6..34ad6f6dd8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/UNIMARCslim2OPACDetail.xsl @@ -27,85 +27,61 @@ - - - External resource(s): - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -737,4 +713,33 @@ + + + + + + + + + + + + + + + + + + + + + -- 2.39.5