Bugzilla – Attachment 35909 Details for
Bug 13707
Adding a new column datereceived for items and biblioitems
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13707 - Adding a new column datereceived for items and biblioitems. New sortable Zebra index.
Bug-13707---Adding-a-new-column-datereceived-for-i.patch (text/plain), 8.78 KB, created by
Olli-Antti Kivilahti
on 2015-02-13 16:07:32 UTC
(
hide
)
Description:
Bug 13707 - Adding a new column datereceived for items and biblioitems. New sortable Zebra index.
Filename:
MIME Type:
Creator:
Olli-Antti Kivilahti
Created:
2015-02-13 16:07:32 UTC
Size:
8.78 KB
patch
obsolete
>From dd7de23fed17f1ea9a4ffc5ff55d2b8dd6510f2c Mon Sep 17 00:00:00 2001 >From: Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> >Date: Fri, 13 Feb 2015 18:06:19 +0200 >Subject: [PATCH] Bug 13707 - Adding a new column datereceived for items and > biblioitems. New sortable Zebra index. > >--- > C4/Search.pm | 8 ++++++++ > Koha/QueryParser/Driver/PQF.pm | 2 ++ > etc/zebradb/biblios/etc/bib1.att | 1 + > etc/zebradb/ccl.properties | 3 +++ > .../marc21/biblios/biblio-koha-indexdefs.xml | 11 +++++++++++ > .../marc21/biblios/biblio-zebra-indexdefs.xsl | 14 ++++++++++++++ > .../intranet-tmpl/prog/en/includes/resort_form.inc | 12 ++++++++++++ > .../bootstrap/en/includes/resort_form.inc | 10 ++++++++++ > 8 files changed, 61 insertions(+) > >diff --git a/C4/Search.pm b/C4/Search.pm >index 5216a12..f7f50cb 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -413,6 +413,12 @@ sub getRecords { > elsif ( $sort eq "acqdate_dsc" ) { > $sort_by .= "1=32 >i "; > } >+ elsif ( $sort eq "datereceived_asc" ) { >+ $sort_by .= "1=9015 <i "; >+ } >+ elsif ( $sort eq "datereceived_dsc" ) { >+ $sort_by .= "1=9015 >i "; >+ } > elsif ( $sort eq "title_az" || $sort eq "title_asc" ) { > $sort_by .= "1=4 <i "; > } >@@ -1131,6 +1137,8 @@ sub getIndexes{ > 'date-entered-on-file', > 'Date-of-acquisition', > 'Date-of-publication', >+ 'Date-of-receival', >+ 'datereceived', > 'Dewey-classification', > 'Dissertation-information', > 'EAN', >diff --git a/Koha/QueryParser/Driver/PQF.pm b/Koha/QueryParser/Driver/PQF.pm >index 8181cd3..6e41ce2 100644 >--- a/Koha/QueryParser/Driver/PQF.pm >+++ b/Koha/QueryParser/Driver/PQF.pm >@@ -701,6 +701,8 @@ sub TEST_SETUP { > $self->add_bib1_filter_map( 'biblioserver', 'copydate', { 'target_syntax_callback' => \&Koha::QueryParser::Driver::PQF::date_filter_target_callback, '1' => '30', '4' => '4' }); > $self->add_bib1_filter_map( 'biblioserver', 'pubdate', { 'target_syntax_callback' => \&Koha::QueryParser::Driver::PQF::date_filter_target_callback, '1' => 'pubdate', '4' => '4' }); > $self->add_bib1_filter_map( 'biblioserver', 'acqdate', { 'target_syntax_callback' => \&Koha::QueryParser::Driver::PQF::date_filter_target_callback, '1' => 'Date-of-acquisition', '4' => '4' }); >+ $self->add_bib1_field_map('keyword' => 'datereceived' => 'biblioserver' => { '1' => '9015' } ); >+ $self->add_search_field_alias( 'keyword' => 'date-of-receival' => 'datereceived' ); > $self->add_bib1_field_map('keyword' => 'isbn' => 'biblioserver' => { '1' => '7' } ); > $self->add_search_field_alias( 'keyword' => 'isbn' => 'nb' ); > $self->add_bib1_field_map('keyword' => 'issn' => 'biblioserver' => { '1' => '8' } ); >diff --git a/etc/zebradb/biblios/etc/bib1.att b/etc/zebradb/biblios/etc/bib1.att >index ed8c64b..8b7baa5 100644 >--- a/etc/zebradb/biblios/etc/bib1.att >+++ b/etc/zebradb/biblios/etc/bib1.att >@@ -219,6 +219,7 @@ att 9009 cn-prefix > att 9010 cn-suffix > att 9011 Suppress > att 9012 Identifier-other >+att 9015 Date-of-receival > > # Items Index > att 8001 withdrawn >diff --git a/etc/zebradb/ccl.properties b/etc/zebradb/ccl.properties >index 99e3498..daf29a0 100644 >--- a/etc/zebradb/ccl.properties >+++ b/etc/zebradb/ccl.properties >@@ -346,6 +346,9 @@ pubdate Date-of-publication > Date-of-acquisition 1=32 > acqdate Date-of-acquisition > >+Date-of-receival 1=9015 >+datereceived Date-of-receival >+ > #Date/time added to 1011 The date and time that a 008/00-05 > #database record was added to the > # database. >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 c7dd166..4c8c0a8 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >@@ -1095,6 +1095,12 @@ > <target_index>totalissues:n</target_index> > <target_index>totalissues:s</target_index> > </index_subfields> >+ <!--record.abs line 298: melm 942$1 Date-of-receival,Date-of-receival:d,Date-of-receival:s--> >+ <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="942" subfields="1"> >+ <target_index>Date-of-receival:w</target_index> >+ <target_index>Date-of-receival:d</target_index> >+ <target_index>Date-of-receival:s</target_index> >+ </index_subfields> > <!--record.abs line 271: melm 942$2 cn-bib-source--> > <index_subfields tag="942" subfields="2"> > <target_index>cn-bib-source:w</target_index> >@@ -1255,6 +1261,11 @@ > <index_subfields tag="952" subfields="r"> > <target_index>datelastseen:w</target_index> > </index_subfields> >+ <!--record.abs line 298: melm 952$R Date-of-receival,Date-of-receival:d--> >+ <index_subfields xmlns="http://www.koha-community.org/schemas/index-defs" tag="952" subfields="R"> >+ <target_index>Date-of-receival:w</target_index> >+ <target_index>Date-of-receival:d</target_index> >+ </index_subfields> > <!--record.abs line 313: melm 952$s datelastborrowed--> > <index_subfields tag="952" subfields="s"> > <target_index>datelastborrowed:w</target_index> >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 db4c6f2..8a14395 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >@@ -1056,6 +1056,13 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </xslo:if> > </xslo:for-each> > <xslo:for-each select="marc:subfield"> >+ <xslo:if test="contains('1', @code)"> >+ <z:index name="Date-of-receival:w Date-of-receival:d Date-of-receival:s"> >+ <xslo:value-of select="."/> >+ </z:index> >+ </xslo:if> >+ </xslo:for-each> >+ <xslo:for-each select="marc:subfield"> > <xslo:if test="contains('2', @code)"> > <z:index name="cn-bib-source:w"> > <xslo:value-of select="."/> >@@ -1296,6 +1303,13 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > </xslo:if> > </xslo:for-each> > <xslo:for-each select="marc:subfield"> >+ <xslo:if test="contains('R', @code)"> >+ <z:index name="Date-of-receival:w Date-of-receival:d"> >+ <xslo:value-of select="."/> >+ </z:index> >+ </xslo:if> >+ </xslo:for-each> >+ <xslo:for-each select="marc:subfield"> > <xslo:if test="contains('s', @code)"> > <z:index name="datelastborrowed:w"> > <xslo:value-of select="."/> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/resort_form.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/resort_form.inc >index 4326bea..ca1176c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/resort_form.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/resort_form.inc >@@ -70,6 +70,18 @@ > [% ELSE %] > <option value="acqdate_asc">Acquisition date: oldest to newest</option> > [% END %] >+ >+[% IF ( sort_by == "datereceived_dsc" ) %] >+ <option value="datereceived_dsc" selected="selected">Receival date: newest to oldest</option> >+[% ELSE %] >+ <option value="datereceived_dsc">Receival date: newest to oldest</option> >+[% END %] >+ >+[% IF ( sort_by == "datereceived_asc" ) %] >+ <option value="datereceived_asc" selected="selected">Receival date: oldest to newest</option> >+[% ELSE %] >+ <option value="datereceived_asc">Receival date: oldest to newest</option> >+[% END %] > </optgroup> > > <optgroup label="Title"> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/resort_form.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/resort_form.inc >index c5a30f6..a20ad96 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/resort_form.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/resort_form.inc >@@ -56,6 +56,16 @@ > [% ELSE %] > <option value="acqdate_asc">Acquisition date: Oldest to newest</option> > [% END %] >+ [% IF ( sort_by == "datereceived_dsc" ) %] >+ <option value="datereceived_dsc" selected="selected">Receival date: Newest to oldest</option> >+ [% ELSE %] >+ <option value="datereceived_dsc">Receival date: Newest to oldest</option> >+ [% END %] >+ [% IF ( sort_by == "datereceived_asc" ) %] >+ <option value="datereceived_asc" selected="selected">Receival date: Oldest to newest</option> >+ [% ELSE %] >+ <option value="datereceived_asc">Receival date: Oldest to newest</option> >+ [% END %] > </optgroup> > <optgroup label="Title"> > [% IF ( sort_by == "title_az" || sort_by == "title_asc" ) %] >-- >1.7.9.5
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 13707
:
35908
|
35909
|
35910
|
35917
|
35933
|
35944
|
35945
|
35946
|
35966
|
35967
|
35968
|
35970
|
42391
|
42394
|
64343
|
64344