From 0fbd4b19851354bc03bd08835173e8132572bec8 Mon Sep 17 00:00:00 2001 From: Alexander Wagner Date: Fri, 5 Jul 2024 14:43:49 +0200 Subject: [PATCH] Bug 37196: Add automatic punctuation for Marc-245 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the Marc Leader 18 is set to `c` or `n` add the necessary punctuation for the Marc21 field 245 automatically. Otherwise assume the punctuation exists and use the subfield data _as is_. The following subfields are handled: bcfghknps Additionally, all title parts are enclosed in individual `` tags with proper class assignments to allow for easy styling of all the individual parts. Note: some special cases (like title translations that should get an `=` instead of a `:`) can not be handled fully automatically. The change applies to: - OPAC results - OPAC details - intranet results - intranet details Testplan: 1. Start `ktd` 2. Check a record with additional title fields. Examples: - biblionumber 55: Dàin do Eimhir = Poems to Eimhir / Somhairle MacGill-Eain = Sorley MacLean ; edited by Christopher Whyte. - biblionumber 58 'More fruitful than the soil' : army, empire and the Scottish Highlands, 1715-1815 / Andrew Mackillop. Those should display correctly, as they hold all punctuations _in_ the record. (Marc Leader 18 set to `a`). 3. Apply the patch 4. Call up the records again They should display unchanged as the Leader 18 is still set to `a` => no automatic punctuation is applied 5. Edit both records and only set the Leader 18 to either `c` or `n`. (Note: this is _incorrect_ wrt the record semantic.) All punctuation chars appear _twice_ as Koha adds them automatically as instructed even though they are there. The title display like - Dàin do Eimhir = : Poems to Eimhir / / Somhairle MacGill-Eain = Sorley MacLean ; edited by Christopher Whyte. - 'More fruitful than the soil' : : army, empire and the Scottish Highlands, 1715-1815 / / Andrew Mackillop. Note that for biblionumber 55 Koha displays `= :` as it is not possible to know automatically that there should be an `=` instad of the `:`. Sponsored-by: Deutsches Elektronen-Synchrotron DESY, Library --- .../intranet-tmpl/prog/en/xslt/MARC21_245.xsl | 97 +++++++++++++++++++ .../en/xslt/MARC21slim2intranetDetail.xsl | 29 +----- .../en/xslt/MARC21slim2intranetResults.xsl | 28 +----- .../bootstrap/en/xslt/MARC21_245.xsl | 97 +++++++++++++++++++ .../en/xslt/MARC21slim2OPACDetail.xsl | 38 ++------ .../en/xslt/MARC21slim2OPACResults.xsl | 28 +----- 6 files changed, 210 insertions(+), 107 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21_245.xsl create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21_245.xsl diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21_245.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21_245.xsl new file mode 100644 index 0000000000..b356e9c0dc --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21_245.xsl @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + a + + + + + + + + + + : + + + + + + / + + + + + , + + + + + , + + + + + + + [ + + ] + + + + + + : + + + + + : + + + + + , + + + + + . + + + + + + + + + + + + + + + diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl index 48439f3a24..f33c44dc76 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl @@ -10,6 +10,8 @@ xmlns:str="http://exslt.org/strings" exclude-result-prefixes="marc str"> + + @@ -110,33 +112,10 @@ - +

- - - a - - - - - - - - - - - - - - - - - - - - - +

diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl index 16a423e421..764ffd5c24 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl +++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl @@ -7,6 +7,7 @@ xmlns:str="http://exslt.org/strings" exclude-result-prefixes="marc str"> + @@ -308,32 +309,7 @@ title - - - - a - - - - - - - - - - - - - - - - - - - - - - + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21_245.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21_245.xsl new file mode 100644 index 0000000000..b356e9c0dc --- /dev/null +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21_245.xsl @@ -0,0 +1,97 @@ + + + + + + + + + + + + + + + + + + a + + + + + + + + + + : + + + + + + / + + + + + , + + + + + , + + + + + + + [ + + ] + + + + + + : + + + + + : + + + + + , + + + + + . + + + + + + + + + + + + + + + diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl index 3fe783b615..0cbb70d59b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACDetail.xsl @@ -8,6 +8,8 @@ xmlns:str="http://exslt.org/strings" exclude-result-prefixes="marc str"> + + @@ -129,36 +131,12 @@ - - -

- - - a - - - - - - - - - - - - - - - - - - - - - -

-
- + + +

+ +

+
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl index c2ebe9c7d9..9cdbce68a8 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl +++ b/koha-tmpl/opac-tmpl/bootstrap/en/xslt/MARC21slim2OPACResults.xsl @@ -9,6 +9,7 @@ xmlns:str="http://exslt.org/strings" exclude-result-prefixes="marc items str" extension-element-prefixes="exsl"> + @@ -431,32 +432,7 @@ - - - - a - - - - - - - - - - - - - - - - - - - - - - + -- 2.39.2