Bugzilla – Attachment 61657 Details for
Bug 18322
Add facets for ccode to zebra
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Add a facet for ccode fields to Zebra
Add-a-facet-for-ccode-fields-to-Zebra.patch (text/plain), 6.14 KB, created by
Martin Renvoize (ashimema)
on 2017-03-28 08:09:53 UTC
(
hide
)
Description:
Add a facet for ccode fields to Zebra
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2017-03-28 08:09:53 UTC
Size:
6.14 KB
patch
obsolete
>From acc63b4755ee7f8a4b3131fc4f54da89212fa946 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Thu, 23 Mar 2017 10:49:09 +0000 >Subject: [PATCH] Add a facet for ccode fields to Zebra > >This patch adds the index definitions for zebra faceting of ccode in >koha for marc21, normarc and unimarc. > >We also add lines to the templates to expose the new facet and enable >non-zebra faceting for ccode too. > >https://bugs.koha-community.org/show_bug.cgi?id=18322 >--- > C4/Koha.pm | 10 ++++++++++ > etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml | 3 +++ > .../marc_defs/normarc/biblios/biblio-koha-indexdefs.xml | 3 +++ > .../marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml | 6 ++++++ > koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc | 6 +++--- > 6 files changed, 26 insertions(+), 4 deletions(-) > >diff --git a/C4/Koha.pm b/C4/Koha.pm >index 9f06226..ea9c82e 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -520,6 +520,11 @@ sub getFacets { > idx => 'location', > label => 'Location', > tags => [ qw/ 995e / ], >+ }, >+ { >+ idx => 'ccode', >+ label => 'CollectionCodes', >+ tags => [ qw / 099t 955h / ], > } > ]; > >@@ -602,6 +607,11 @@ sub getFacets { > label => 'Location', > tags => [ qw / 952c / ], > }, >+ { >+ idx => 'ccode', >+ label => 'CollectionCodes', >+ tags => [ qw / 9528 / ], >+ } > ]; > > unless ( Koha::Libraries->search->count == 1 ) >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 355a6e3..889db52 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >@@ -1409,5 +1409,8 @@ > <facet tag="952" subfields="y"> > <target_index>itype:0</target_index> > </facet> >+ <facet tag="952" subfields="8"> >+ <target_index>ccode:0</target_index> >+ </facet> > > </kohaidx:index_defs> >diff --git a/etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml b/etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml >index dff2d75..76173ce 100644 >--- a/etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml >@@ -1008,5 +1008,8 @@ > <facet tag="952" subfields="y"> > <target_index>itype:0</target_index> > </facet> >+ <facet tag="952" subfields="8"> >+ <target_index>ccode:0</target_index> >+ </facet> > > </kohaidx:index_defs> >diff --git a/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml b/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml >index 90e92a0..e781adb 100644 >--- a/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml >@@ -1444,6 +1444,9 @@ > <target_index>totalissues:s</target_index> > </index_subfields> > >+ <facet tag="099" subfields="t"> >+ <target_index>ccode:0</target_index> >+ </facet> > <facet tag="225" subfields="a"> > <target_index>se:0</target_index> > </facet> >@@ -1498,5 +1501,8 @@ > <facet tag="995" subfields="e"> > <target_index>location:0</target_index> > </facet> >+ <facet tag="995" subfields="h"> >+ <target_index>ccode:0</target_index> >+ </facet> > > </kohaidx:index_defs> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc >index 572be95..eeb97ac 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/facets.inc >@@ -21,7 +21,7 @@ > [% IF ( facets_loo.type_label_HomeLibrary ) %]<span id="facet-home-libraries">Home libraries</span>[% END %] > [% IF ( facets_loo.type_label_HoldingLibrary ) %]<span id="facet-holding-libraries">Holding libraries</span>[% END %] > [% IF facets_loo.type_label_Location %]<span id="facet-locations">Locations</span>[% END %] >-[% IF facets_loo.type_label_CollectionCodes %]<span id="facet-locations">Collections</span>[% END %] >+[% IF facets_loo.type_label_CollectionCodes %]<span id="facet-collections">Collections</span>[% END %] > <ul> > [% SET url = "/cgi-bin/koha/catalogue/search.pl?" _ query_cgi _ limit_cgi %] > [% IF ( sort_by ) %] >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..c93d604 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-facets.inc >@@ -25,10 +25,10 @@ > [% 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 %] > [% IF facets_loo.type_label_ItemTypes %]<h5 id="facet-itemtypes">Item types</h5>[% END %] >- [% IF facets_loo.type_label_CollectionCodes %]<h5 id="facet-itemtypes">Collections</h5>[% END %] >+ [% IF facets_loo.type_label_CollectionCodes %]<h5 id="facet-collections">Collections</h5>[% END %] > [% UNLESS singleBranchMode %] >- [% IF ( facets_loo.type_label_HomeLibrary ) %]<span id="facet-home-libraries">Home libraries</span>[% END %] >- [% IF ( facets_loo.type_label_HoldingLibrary ) %]<span id="facet-holding-libraries">Holding libraries</span>[% END %] >+ [% IF ( facets_loo.type_label_HomeLibrary ) %]<h5 id="facet-home-libraries">Home libraries</h5>[% END %] >+ [% IF ( facets_loo.type_label_HoldingLibrary ) %]<h5 id="facet-holding-libraries">Holding libraries</h5>[% END %] > [% END %] > [% IF facets_loo.type_label_Location %]<h5 id="facet-locations">Locations</h5>[% END %] > <ul> >-- >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 18322
:
61581
|
61597
|
61612
|
61643
|
61657
|
67823
|
75997
|
76007
|
76008
|
76009
|
76021
|
76023
|
76024
|
76025
|
76026