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 Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
parent
051a9d740f
commit
cb0f279390
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Reference in New Issue