From acc63b4755ee7f8a4b3131fc4f54da89212fa946 Mon Sep 17 00:00:00 2001 From: Martin Renvoize 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 @@ itype:0 + + ccode:0 + 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 @@ itype:0 + + ccode:0 + 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 @@ totalissues:s + + ccode:0 + se:0 @@ -1498,5 +1501,8 @@ location:0 + + ccode:0 + 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 ) %]Home libraries[% END %] [% IF ( facets_loo.type_label_HoldingLibrary ) %]Holding libraries[% END %] [% IF facets_loo.type_label_Location %]Locations[% END %] -[% IF facets_loo.type_label_CollectionCodes %]Collections[% END %] +[% IF facets_loo.type_label_CollectionCodes %]Collections[% END %]