Bugzilla – Attachment 114588 Details for
Bug 18017
Use index_heading and index_match_heading in UNIMARC authorities zebra configuration
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18017: Add subdivisions to UNIMARC authorities zebra configuration
Bug-18017-Add-subdivisions-to-UNIMARC-authorities-.patch (text/plain), 2.95 KB, created by
Fridolin Somers
on 2020-12-22 10:33:46 UTC
(
hide
)
Description:
Bug 18017: Add subdivisions to UNIMARC authorities zebra configuration
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2020-12-22 10:33:46 UTC
Size:
2.95 KB
patch
obsolete
>From 6b5b47b31b3a5d6e9e68af240ebbc153223fb693 Mon Sep 17 00:00:00 2001 >From: Fridolin Somers <fridolin.somers@biblibre.com> >Date: Thu, 17 Dec 2020 15:47:48 +0100 >Subject: [PATCH] Bug 18017: Add subdivisions to UNIMARC authorities zebra > configuration > >Like for MARC21, UNIMARC authorities has subdivisions form, general, >chronological and geographic. > >In C4::Heading::UNIMARC, use subdivisions in _get_search_heading like in C4::Heading::MARC21. > >Adds subdivisions variables into UNIMARC authorities zebra configuration. > >Note that unlike MARC21 geographic is subfield $y and chronological is subfield $z. >See https://www.ifla.org/publications/unimarc-formats-and-related-documentation >--- > C4/Heading/UNIMARC.pm | 13 +++++++++---- > .../authorities/authority-koha-indexdefs.xml | 6 ++++++ > 2 files changed, 15 insertions(+), 4 deletions(-) > >diff --git a/C4/Heading/UNIMARC.pm b/C4/Heading/UNIMARC.pm >index f1b5287708..b998433a43 100644 >--- a/C4/Heading/UNIMARC.pm >+++ b/C4/Heading/UNIMARC.pm >@@ -52,8 +52,8 @@ FIXME - this should be moved to a configuration file. > my %subdivisions = ( > 'j' => 'formsubdiv', > 'x' => 'generalsubdiv', >- 'y' => 'chronologicalsubdiv', >- 'z' => 'geographicsubdiv', >+ 'y' => 'geographicsubdiv', >+ 'z' => 'chronologicalsubdiv', > ); > > my $bib_heading_fields; >@@ -160,14 +160,19 @@ sub _get_search_heading { > my $code = $subfields[$i]->[0]; > my $code_re = quotemeta $code; > my $value = $subfields[$i]->[1]; >- $value =~ s/[-,.:=;!%\/]*$//; >+ $value =~ s/[\s]*[-,.:=;!%\/][\s]*$//; > next unless $subfields =~ qr/$code_re/; > if ($first) { > $first = 0; > $heading = $value; > } > else { >- $heading .= " $value"; >+ if ( exists $subdivisions{$code} ) { >+ $heading .= " $subdivisions{$code} $value"; >+ } >+ else { >+ $heading .= " $value"; >+ } > } > } > >diff --git a/etc/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml b/etc/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml >index 00b4e0be07..91399e3ad7 100644 >--- a/etc/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/unimarc/authorities/authority-koha-indexdefs.xml >@@ -7,6 +7,12 @@ authority-zebra-indexdefs.xsl` > --> > <kohaidx:index_defs xmlns:kohaidx="http://www.koha-community.org/schemas/index-defs"> > <kohaidx:id>marc:controlfield[@tag='001']</kohaidx:id> >+ <!-- variables --> >+ <kohaidx:var name="form_subdivision_subfield">j</kohaidx:var> >+ <kohaidx:var name="general_subdivision_subfield">x</kohaidx:var> >+ <kohaidx:var name="geographic_subdivision_subfield">y</kohaidx:var> >+ <kohaidx:var name="chronological_subdivision_subfield">z</kohaidx:var> >+ > <!-- Original record ID --> > <kohaidx:index_control_field tag="001"> > <kohaidx:target_index>Local-Number:w</kohaidx:target_index> >-- >2.29.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18017
:
59675
|
114588
|
114589
|
114590
|
117182
|
117183
|
117350
|
117351