From b0ee3486a1eb099182ba16fd1f9a9af3cb34beee Mon Sep 17 00:00:00 2001 From: David Bourgault Date: Wed, 27 Sep 2017 14:32:49 -0400 Subject: [PATCH] Bug 19376 - Adds 655$a to Zebra facets Test plan: 0) Apply patch 1) Depending on your setup, copy the content of the following files to their counterparts in /etc/ (or where your Koha configuration files are) : /etc/zebradb/biblios/etc/bib1.att /etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml /etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xsl /etc/zebradb/marc_defs/marc21/biblios/record.abs /etc/zebradb/ccl.properties 2) Edit a record to use the 655$a MARC tag, if you don't already 3) In the OPAC or Intranet, execute a search that would get a hit on the record you edited. > You should see the "Genre form" filter appear on the left 4) Click on the entry under "Genre form" > You should now only see the records with the matching 655$a tag. Signed-off-by: Hugo Agud --- C4/Koha.pm | 7 ++++++- C4/Search.pm | 1 + etc/zebradb/biblios/etc/bib1.att | 1 + etc/zebradb/ccl.properties | 6 ++++++ .../marc21/biblios/biblio-koha-indexdefs.xml | 24 ++++++++-------------- .../marc21/biblios/biblio-zebra-indexdefs.xsl | 20 +++++++----------- etc/zebradb/marc_defs/marc21/biblios/record.abs | 3 +-- .../intranet-tmpl/prog/en/includes/facets.inc | 1 + .../bootstrap/en/includes/opac-facets.inc | 1 + 9 files changed, 33 insertions(+), 31 deletions(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index f547fe0..557e08b 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -395,7 +395,7 @@ sub getFacets { idx => 'location', label => 'Location', tags => [ qw/ 995e / ], - } + }, ]; unless ( Koha::Libraries->search->count == 1 ) @@ -477,6 +477,11 @@ sub getFacets { label => 'Location', tags => [ qw / 952c / ], }, + { + idx => 'gen-for', + label => 'GenreForm', + tags => [qw / 655a / ], + }, ]; unless ( Koha::Libraries->search->count == 1 ) diff --git a/C4/Search.pm b/C4/Search.pm index 9278f26..68b0584 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1137,6 +1137,7 @@ sub getIndexes{ 'Form-subdivision', 'format', 'Geographic-subdivision', + 'gen-for', 'he', 'Heading', 'Heading-use-main-or-added-entry', diff --git a/etc/zebradb/biblios/etc/bib1.att b/etc/zebradb/biblios/etc/bib1.att index 7acdc18..59387c0 100644 --- a/etc/zebradb/biblios/etc/bib1.att +++ b/etc/zebradb/biblios/etc/bib1.att @@ -67,6 +67,7 @@ att 60 CODEN att 61 Microform-generation att 62 Abstract att 63 Note +att 64 gen-for att 1000 Author-title # Record-type, reduced in size because limited line length for leader indexing att 1001 rtype diff --git a/etc/zebradb/ccl.properties b/etc/zebradb/ccl.properties index a1ea690..cb0ea1a 100644 --- a/etc/zebradb/ccl.properties +++ b/etc/zebradb/ccl.properties @@ -558,6 +558,12 @@ Term-genre-form-seealso 1=Term-genre-form-seealso Place-publication 1=59 pl Place-publication +#Genre form auth type genre/form 655$a +# +# +genreform 1=64 +gen-for genreform + #Country-publication 1053 The country code or the 008/15-17 # country name of the country UNIMARC 102$a # where the document has been diff --git a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml b/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml index b67da41..c72bc74 100644 --- a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml +++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml @@ -764,22 +764,13 @@ Index-term-genre:w Index-term-genre:p - Subject:w - Subject:p + gen-for:w + gen-for:p Koha-Auth-Number:w - - - Subject:w - Subject:p - - - - Koha-Auth-Number:w - Subject:w @@ -794,21 +785,21 @@ Subject:w Subject:p - + curriculum:w curriculum:p Subject:w Subject:p - + curriculum:w curriculum:p Subject:w Subject:p - + curriculum:w curriculum:p @@ -973,7 +964,7 @@ Host-item:w - + Host-Item-Number:w @@ -1395,6 +1386,9 @@ su-geo:0 + + gen-for:0 + au:0 diff --git a/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl b/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl index 035d3bc..e1835d5 100644 --- a/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl +++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl @@ -692,7 +692,7 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) - + @@ -2341,18 +2341,12 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) - - - - - - - - - - - - + + + + + + diff --git a/etc/zebradb/marc_defs/marc21/biblios/record.abs b/etc/zebradb/marc_defs/marc21/biblios/record.abs index 4882485..6fdb99a 100644 --- a/etc/zebradb/marc_defs/marc21/biblios/record.abs +++ b/etc/zebradb/marc_defs/marc21/biblios/record.abs @@ -194,9 +194,8 @@ melm 653$9 Koha-Auth-Number melm 653 Subject,Subject:p melm 654$9 Koha-Auth-Number melm 654 Subject,Subject:p -melm 655$a Index-term-genre:w,Index-term-genre:p,Subject,Subject:p +melm 655$a gen-for:w,gen-for:p melm 655$9 Koha-Auth-Number -melm 655 Subject,Subject:p melm 656$9 Koha-Auth-Number melm 656 Subject,Subject:p melm 657$9 Koha-Auth-Number diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc index 572be95..4126ced 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc @@ -15,6 +15,7 @@ [% IF facets_loo.type_label_Authors %]Authors[% END %] [% IF facets_loo.type_label_Titles %]Titles[% END %] [% IF facets_loo.type_label_Topics %]Topics[% END %] +[% IF facets_loo.type_label_GenreForm %]Genre form[% END %] [% IF facets_loo.type_label_Places %]Places[% END %] [% IF facets_loo.type_label_Series %]Series[% END %] [% IF facets_loo.type_label_ItemTypes %]Item types[% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc index e89a693..53ee96b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc @@ -21,6 +21,7 @@
  • [% IF facets_loo.type_label_Authors %]
    Authors
    [% END %] [% IF facets_loo.type_label_Titles %]
    Titles
    [% END %] + [% IF facets_loo.type_label_GenreForm %]
    Genre form
    [% END %] [% IF facets_loo.type_label_Topics %]
    Topics
    [% END %] [% IF facets_loo.type_label_Places %]
    Places
    [% END %] [% IF facets_loo.type_label_Series %]
    Series
    [% END %] -- 2.1.4