From f2808f20d7e7cca985c7bb28807c3f106e38efd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Wed, 3 Oct 2012 17:55:50 +0200 Subject: [PATCH 2/2] UNIMARC authorities search doesn't display properly information - Note field (3xx) are not displayed on search result page. We get 'HASH()' text. - Parallel/Other forms (7xx) are not displayed, with language name in front of heading - On result page, seealso form are displayed, and end with '--' This bug is present on 3.8.5. To fix it, several patches only available on HEAD are necessary. --- C4/AuthoritiesMarc.pm | 13 ++++++--- koha-tmpl/opac-tmpl/prog/en/css/opac.css | 4 +++ .../en/includes/authorities-search-results.inc | 29 +++++++++++-------- .../opac-tmpl/prog/en/modules/opac-auth-detail.tt | 24 +++++++++++++--- 4 files changed, 49 insertions(+), 21 deletions(-) diff --git a/C4/AuthoritiesMarc.pm b/C4/AuthoritiesMarc.pm index 2671cd4..8522e0f 100644 --- a/C4/AuthoritiesMarc.pm +++ b/C4/AuthoritiesMarc.pm @@ -1052,10 +1052,15 @@ sub BuildSummary { } } # // form - foreach my $field ($record->field('7..')) { - my $lang = substr($field->subfield('8'),3,3); - push @otherscript, { lang => $lang, term => $field->subfield('a'), direction => 'ltr', field => $field->tag() }; - } + + # Other forms + @otherscript = map { { + lang => $_->subfield('8') || '', + term => $_->subfield('a'), + direction => 'ltr', + field => $_->tag, + } } $record->field('7..'); + } else { # construct MARC21 summary # FIXME - looping over 1XX is questionable diff --git a/koha-tmpl/opac-tmpl/prog/en/css/opac.css b/koha-tmpl/opac-tmpl/prog/en/css/opac.css index 92f8b02..f0464e5 100644 --- a/koha-tmpl/opac-tmpl/prog/en/css/opac.css +++ b/koha-tmpl/opac-tmpl/prog/en/css/opac.css @@ -2682,6 +2682,10 @@ ul.ui-tabs-nav li { .authstanzaheading { font-weight: bold; } +div.authorizedheading { + font-weight: bold; + margin-bottom: 5px; +} .authstanza li { margin-left: 0.5em; diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc b/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc index 58f5f2d..a7ffa5e 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/authorities-search-results.inc @@ -2,15 +2,13 @@ [% IF marcflavour == 'UNIMARC' %] [% SWITCH type %] [% CASE 'broader' %] - [% heading | html %] -- + BT: [% heading | html %] [% CASE 'narrower' %] - [% heading | html %] -- - [% CASE 'narrower' %] - [% heading | html %] -- + NT: [% heading | html %] [% CASE 'seefrom' %] - [% heading | html %] -- + UF: [% heading | html %] [% CASE 'seealso' %] - [% heading | html %] -- + RT: [% heading | html %] [% END %] [% ELSE %] [% IF ( label ) %][% label | html %][% END %] @@ -33,15 +31,22 @@ [% BLOCK authresult %] [% IF ( summary.summary ) %][% summary.summary | html %]:[% END %] [% UNLESS ( summary.summaryonly ) %] - [% FOREACH authorize IN summary.authorized %] +
+ [% FOREACH authorize IN summary.authorized %] [% authorize.heading | html %] - [% END %] + [% END %] +
[% IF ( marcflavour == 'UNIMARC' ) %] - [% FOREACH note IN summary.notes %] - [% note | html %] + [% IF summary.notes %] +
+ [% FOREACH note IN summary.notes %] + [% note.note | html %] + [% END %] +
[% END %] - [% FOREACH seefro IN summary.seefrom %] - [% PROCESS showreference heading=seefro.heading label="" type=seefro.type search='' %] + [% FOREACH see IN summary.seealso %] + [% PROCESS showreference heading=see.heading label="" type=see.type search='' %] + [% IF ! loop.last %]--[% END %] [% END %] [% ELSE %] [% IF ( summary.seefrom ) %] diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth-detail.tt index cb195b1..ada69fe 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth-detail.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-auth-detail.tt @@ -1,4 +1,14 @@ [% PROCESS 'opac-authorities.inc' %] +[% BLOCK language %] + [% SWITCH lang %] + [% CASE ['en', 'eng'] %]English + [% CASE ['fr', 'fre'] %]French + [% CASE ['it', 'ita'] %]Italian + [% CASE ['de', 'ger', 'deu'] %]German + [% CASE ['es', 'spa'] %]Spanish + [% CASE %][% lang %] + [% END %] +[% END %] [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Entry [% INCLUDE 'doc-head-close.inc' %] [% IF ( displayhierarchy ) %] @@ -42,7 +52,7 @@ $(document).ready(function() { [% END %] -

[% summary.mainentry %][% IF authtypetext %]([% authtypetext %])[% END %]

+

[% summary.mainentry %][% IF authtypetext %] ([% authtypetext %])[% END %]

Used in [% count %] records
[% FOREACH authorize IN summary.authorized %] @@ -76,13 +86,17 @@ $(document).ready(function() {
[% END %] [% IF marcflavour == 'UNIMARC' && summary.otherscript %] -
+
+
Other forms:
+
    [% FOREACH otherscrip IN summary.otherscript %] -
    See also[% PROCESS language lang=otherscript.lang | trim %] term: +
  • + [% PROCESS language lang=otherscrip.lang | trim %]: [% otherscrip.term %] -
  • + [% END %] -
+ +
[% END %]