Bugzilla – Attachment 68388 Details for
Bug 19376
Add 655$a (Genre/Form) to zebra search facets
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19376 - Adds 655$a to Zebra facets
Bug-19376---Adds-655a-to-Zebra-facets.patch (text/plain), 11.41 KB, created by
Hugo Agud
on 2017-10-23 12:01:51 UTC
(
hide
)
Description:
Bug 19376 - Adds 655$a to Zebra facets
Filename:
MIME Type:
Creator:
Hugo Agud
Created:
2017-10-23 12:01:51 UTC
Size:
11.41 KB
patch
obsolete
>From b0ee3486a1eb099182ba16fd1f9a9af3cb34beee Mon Sep 17 00:00:00 2001 >From: David Bourgault <david.bourgault@inlibro.com> >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) : ><git>/etc/zebradb/biblios/etc/bib1.att ><git>/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml ><git>/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xsl ><git>/etc/zebradb/marc_defs/marc21/biblios/record.abs ><git>/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 <hagud@orex.es> >--- > 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_subfields tag="655" subfields="a"> > <target_index>Index-term-genre:w</target_index> > <target_index>Index-term-genre:p</target_index> >- <target_index>Subject:w</target_index> >- <target_index>Subject:p</target_index> >+ <target_index>gen-for:w</target_index> >+ <target_index>gen-for:p</target_index> > </index_subfields> > <!--record.abs line 187: melm 655$9 Koha-Auth-Number --> > <index_subfields tag="655" subfields="9"> > <target_index>Koha-Auth-Number:w</target_index> > </index_subfields> >- <!--record.abs line 188: melm 655 Subject,Subject:p--> >- <index_data_field tag="655"> >- <target_index>Subject:w</target_index> >- <target_index>Subject:p</target_index> >- </index_data_field> >- <!--record.abs line 189: melm 656$9 Koha-Auth-Number --> >- <index_subfields tag="656" subfields="9"> >- <target_index>Koha-Auth-Number:w</target_index> >- </index_subfields> > <!--record.abs line 190: melm 656 Subject,Subject:p--> > <index_data_field tag="656"> > <target_index>Subject:w</target_index> >@@ -794,21 +785,21 @@ > <target_index>Subject:w</target_index> > <target_index>Subject:p</target_index> > </index_data_field> >- <!--record.abs line 193: melm 658$a curriculum:w,curriculum:p,Subject,Subject:p--> >+ <!--record.abs line 193: melm 658$a curriculum:w,curriculum:p,Subject,Subject:p--> > <index_subfields tag="658" subfields="a"> > <target_index>curriculum:w</target_index> > <target_index>curriculum:p</target_index> > <target_index>Subject:w</target_index> > <target_index>Subject:p</target_index> > </index_subfields> >- <!--record.abs line 194: melm 658$b curriculum:w,curriculum:p,Subject,Subject:p--> >+ <!--record.abs line 194: melm 658$b curriculum:w,curriculum:p,Subject,Subject:p--> > <index_subfields tag="658" subfields="b"> > <target_index>curriculum:w</target_index> > <target_index>curriculum:p</target_index> > <target_index>Subject:w</target_index> > <target_index>Subject:p</target_index> > </index_subfields> >- <!--record.abs line 195: melm 658$c curriculum:w,curriculum:p,Subject,Subject:p--> >+ <!--record.abs line 195: melm 658$c curriculum:w,curriculum:p,Subject,Subject:p--> > <index_subfields tag="658" subfields="c"> > <target_index>curriculum:w</target_index> > <target_index>curriculum:p</target_index> >@@ -973,7 +964,7 @@ > <index_subfields tag="773" subfields="a"> > <target_index>Host-item:w</target_index> > </index_subfields> >- <!--record.abs line 230: melm 773$9 Host-Item-Number--> >+ <!--record.abs line 230: melm 773$9 Host-Item-Number--> > <index_subfields tag="773" subfields="9"> > <target_index>Host-Item-Number:w</target_index> > </index_subfields> >@@ -1395,6 +1386,9 @@ > <facet tag="651" subfields="a"> > <target_index>su-geo:0</target_index> > </facet> >+ <facet tag="655" subfields="a"> >+ <target_index>gen-for:0</target_index> >+ </facet> > <facet tag="700" subfields="a"> > <target_index>au:0</target_index> > </facet> >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) > <xslo:template mode="index_subfields" match="marc:datafield[@tag='655']"> > <xslo:for-each select="marc:subfield"> > <xslo:if test="contains('a', @code)"> >- <z:index name="Index-term-genre:w Index-term-genre:p Subject:w Subject:p"> >+ <z:index name="Index-term-genre:w Index-term-genre:p gen-for:w gen-for:p"> > <xslo:value-of select="."/> > </z:index> > </xslo:if> >@@ -2341,18 +2341,12 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > <xslo:value-of select="normalize-space($raw_heading)"/> > </z:index> > </xslo:template> >- <xslo:template mode="index_data_field" match="marc:datafield[@tag='655']"> >- <z:index name="Subject:w Subject:p"> >- <xslo:variable name="raw_heading"> >- <xslo:for-each select="marc:subfield"> >- <xslo:if test="position() > 1"> >- <xslo:value-of select="substring(' ', 1, 1)"/> >- </xslo:if> >- <xslo:value-of select="."/> >- </xslo:for-each> >- </xslo:variable> >- <xslo:value-of select="normalize-space($raw_heading)"/> >- </z:index> >+ <xslo:template mode="index_facets" match="marc:datafield[@tag='655']"> >+ <xslo:if test="not(@ind1='z')"> >+ <z:index name="gen-for:0"> >+ <xslo:value-of select="marc:subfield[@code='a']"/> >+ </z:index> >+ </xslo:if> > </xslo:template> > <xslo:template mode="index_data_field" match="marc:datafield[@tag='656']"> > <z:index name="Subject:w Subject:p"> >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 %]<span id="facet-authors">Authors</span>[% END %] > [% IF facets_loo.type_label_Titles %]<span id="facet-titles">Titles</span>[% END %] > [% IF facets_loo.type_label_Topics %]<span id="facet-topics">Topics</span>[% END %] >+[% IF facets_loo.type_label_GenreForm %]<span id="facet-genreform">Genre form</span>[% END %] > [% IF facets_loo.type_label_Places %]<span id="facet-places">Places</span>[% END %] > [% IF facets_loo.type_label_Series %]<span id="facet-series">Series</span>[% END %] > [% IF facets_loo.type_label_ItemTypes %]<span id="facet-itemtypes">Item types</span>[% 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 @@ > <li id="[% facets_loo.type_id %]"> > [% IF facets_loo.type_label_Authors %]<h5 id="facet-authors">Authors</h5>[% END %] > [% IF facets_loo.type_label_Titles %]<h5 id="facet-titles">Titles</h5>[% END %] >+ [% IF facets_loo.type_label_GenreForm %]<h5 id="facet-genreform">Genre form</h5>[% END %] > [% IF facets_loo.type_label_Topics %]<h5 id="facet-topics">Topics</h5>[% END %] > [% IF facets_loo.type_label_Places %]<h5 id="facet-places">Places</h5>[% END %] > [% IF facets_loo.type_label_Series %]<h5 id="facet-series">Series</h5>[% END %] >-- >2.1.4
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 19376
:
67412
|
68221
|
68245
|
68388
|
68389
|
71978
|
84377
|
84378
|
84379
|
84380
|
84383
|
84384
|
84385