From 1c7dec33eb19a4f2bd77be783f74ee8abd97de2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Tue, 26 May 2015 18:23:11 +0200 Subject: [PATCH] Bug 13904: Make unimarc_field_4XX displays usefull 200 subfield data When searching for multivolumes titles, UNIMARC 4xx field plugin displays the title of the biblios (200$a), without giving info about volumes (200 $h $i). It neither doesn't display $e (subtitle) info which could greatly help to disambiguate search result. The displayed title is supposed to link to a biblio record view (MARC / normal). It doesn't work. TO TEST: - On a UNIMARC Koha, add a new biblio record - Call the 4XX plugin from 461/463 field - Search for a biblio record which contains 200$e, and/or 200$h and/or 200$i subfields. - You get a result list, with two issues: 1. $a, $h & $i aren't displayed 2. Biblio title is not a link - Apply the patch, and repeat previous steps. --- cataloguing/value_builder/unimarc_field_4XX.pl | 8 ++++++++ .../cataloguing/value_builder/unimarc_field_4XX.tt | 16 ++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/cataloguing/value_builder/unimarc_field_4XX.pl b/cataloguing/value_builder/unimarc_field_4XX.pl index 5ab5bf1..56b5e14 100755 --- a/cataloguing/value_builder/unimarc_field_4XX.pl +++ b/cataloguing/value_builder/unimarc_field_4XX.pl @@ -378,7 +378,15 @@ sub plugin { ) { my $record = C4::Search::new_record_from_zebra( 'biblioserver', $results->[$i] ); + next unless $record; my $rechash = TransformMarcToKoha( $dbh, $record ); + if ( my $f = $record->field('200') ) { + $rechash->{fulltitle} = + join(', ', map { $_->[1] } grep { $_->[0] =~ /[aehi]/ } $f->subfields() ); + } + else { + $rechash->{fulltitle} = $rechash->{title}; + } my $pos; my $countitems; if ( $rechash->{itemnumber} ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tt index 66d5223..77235ea 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/value_builder/unimarc_field_4XX.tt @@ -167,15 +167,15 @@ [% IF ( resul.even ) %] [% ELSE %][% END %] [% IF ( resul.MARC_ON ) %] - [% resul.title |html %] + [% resul.title |html %] [% ELSE %] - [% resul.title |html %] [% END %] -

[% resul.author |html %] - [% IF ( resul.publishercode ) %]- [% resul.publishercode |html %][% END %] - [% IF ( resul.place ) %] ; [% resul.place |html %][% END %] - [% IF ( resul.pages ) %] - [% resul.pages |html %][% END %] - [% IF ( resul.notes ) %] : [% resul.notes |html %][% END %] - [% IF ( resul.item('size') ) %] ; [% resul.item('size') |html %][% END %] + [% resul.fulltitle |html %] [% END %] +

[% resul.author %] + [% IF ( resul.publishercode ) %]- [% resul.publishercode %][% END %] + [% IF ( resul.place ) %] ; [% resul.place %][% END %] + [% IF ( resul.pages ) %] - [% resul.pages %][% END %] + [% IF ( resul.notes ) %] : [% resul.notes %][% END %] + [% IF ( resul.size ) %] ; [% resul.size %][% END %]

[% IF ( resul.even ) %] -- 2.3.5