From 4c01be67d4d84bd77dd6a6df8718727b138942b5 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 Signed-off-by: David Cook --- 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 | 8 ++++++-- 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(+), 6 deletions(-) diff --git a/C4/Koha.pm b/C4/Koha.pm index f547fe018e..b77879ca1c 100644 --- a/C4/Koha.pm +++ b/C4/Koha.pm @@ -395,6 +395,11 @@ sub getFacets { idx => 'location', label => 'Location', tags => [ qw/ 995e / ], + }, + { + idx => 'ccode', + label => 'CollectionCodes', + tags => [ qw / 099t 955h / ], } ]; @@ -477,6 +482,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 b67da4193a..b3b12a0e2b 100644 --- a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml +++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml @@ -1413,5 +1413,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 7d2cf08ef0..161ce6a9f9 100644 --- a/etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml +++ b/etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml @@ -1012,5 +1012,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 7c550f80c7..e0068f500f 100644 --- a/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml +++ b/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml @@ -1443,11 +1443,12 @@ totalissues:n totalissues:s - not-onloan-count:n - + + ccode:0 + se:0 @@ -1502,5 +1503,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 572be95594..eeb97ac0f6 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 %]