Bugzilla – Attachment 46510 Details for
Bug 15537
Hide records on Leader 05 = d in OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15537 - Hide records on Leader 05 = d in OPAC
Bug-15537---Hide-records-on-Leader-05--d-in-OPAC.patch (text/plain), 8.09 KB, created by
David Cook
on 2016-01-12 02:28:39 UTC
(
hide
)
Description:
Bug 15537 - Hide records on Leader 05 = d in OPAC
Filename:
MIME Type:
Creator:
David Cook
Created:
2016-01-12 02:28:39 UTC
Size:
8.09 KB
patch
obsolete
>From c2a2e2c85dfb60a7f468340f7843e85667de32cb Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 12 Jan 2016 12:45:31 +1100 >Subject: [PATCH] Bug 15537 - Hide records on Leader 05 = d in OPAC > >Currently, if a bibliographic record has a record status of "deleted" >(ie LDR05=d), it shows up in the catalogue. > >This patch indexes the LDR05 character into the Record-status >index (already defined in bib1.att). It creates a CCL qualifier >for that index, and it adds a condition to OPAC queries where >it only returns records that do not have a LDR05 of "d". > >Test Conditions: > >1) With QueryParser >2) Without QueryParser >3) With OpacSuppression >4) Without OpacSuppression > >Test Plan: > >Before applying patch: >1) Choose a bibliographic record and change the LDR05 to "d" >2) Try searching for that record in the OPAC >3) Note that it appears in the search results (or takes you directly to the record) > >Apply patch. > >After applying patch: >4) Try searching for that record in the OPAC >5) Note that the record doesn't appear in the search results >6) Re-try steps 4 & 5 with each of the 4 test conditions outlined above. >It should work the same regardless of using the QueryParser or OpacSuppression. > >NOTE: When using the QueryParser, you might need to vary your syntax. For instance, >w/ QP you'd need "local-number:492 || local-number:495" whereas w/o QP you'd need >"local-number:492 or local-number:495". > >NOTE: For extra points, double-check the staff client to make sure that you >can still find records that have a LDR05 of "d". >--- > C4/Search.pm | 1 + > etc/zebradb/ccl.properties | 5 +++++ > etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml | 3 +++ > etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl | 3 +++ > etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml | 3 +++ > etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl | 3 +++ > etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml | 3 +++ > etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl | 5 +++++ > opac/opac-search.pl | 7 +++++++ > 9 files changed, 33 insertions(+) > >diff --git a/C4/Search.pm b/C4/Search.pm >index f52e0ee..5140a88 100644 >--- a/C4/Search.pm >+++ b/C4/Search.pm >@@ -1178,6 +1178,7 @@ sub getIndexes{ > 'rcn', > 'Record-type', > 'rtype', >+ 'Record-status', > 'se', > 'See', > 'See-also', >diff --git a/etc/zebradb/ccl.properties b/etc/zebradb/ccl.properties >index f65d269..e3abe74 100644 >--- a/etc/zebradb/ccl.properties >+++ b/etc/zebradb/ccl.properties >@@ -271,6 +271,11 @@ language-original 1=1095 > #Microform-generation 1=61 > #material-designation Microform-generation > >+#Record-status 1046 Information about the status of the record, e.g. new, corrected, deleted, revised. >+Record-status 1=1046 14=1 >+#The special attribute 14=1 shouldn't be necessary as Record-status should never be an empty index, >+#but this is an extra precaution to avoid Zebra errors when an index is empty >+ > #Code-record-type 1001 A code that specifies the Leader/06 > # characteristics and defines > # the components of the record. >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 6b1fb87..337cb96 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-koha-indexdefs.xml >@@ -6,6 +6,9 @@ > <index_leader offset="0" length="5"> > <target_index>llength:w</target_index> > </index_leader> >+ <index_leader offset="5" length="1"> >+ <target_index>Record-status:w</target_index> >+ </index_leader> > <index_leader offset="6" length="1"> > <target_index>rtype:w</target_index> > </index_leader> >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 604c76a..1ab1f4c 100644 >--- a/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/marc21/biblios/biblio-zebra-indexdefs.xsl >@@ -48,6 +48,9 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > <z:index name="llength:w"> > <xslo:value-of select="substring(., 1, 5)"/> > </z:index> >+ <z:index name="Record-status:w"> >+ <xslo:value-of select="substring(., 6, 1)"/> >+ </z:index> > <z:index name="rtype:w"> > <xslo:value-of select="substring(., 7, 1)"/> > </z:index> >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 0918f2a..2e6c44c 100644 >--- a/etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/normarc/biblios/biblio-koha-indexdefs.xml >@@ -6,6 +6,9 @@ > <index_leader offset="0" length="5"> > <target_index>llength:w</target_index> > </index_leader> >+ <index_leader offset="5" length="1"> >+ <target_index>Record-status:w</target_index> >+ </index_leader> > <index_leader offset="6" length="1"> > <target_index>rtype:w</target_index> > </index_leader> >diff --git a/etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl b/etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl >index 1eeca69..110dc6b 100644 >--- a/etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/normarc/biblios/biblio-zebra-indexdefs.xsl >@@ -48,6 +48,9 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > <z:index name="llength:w"> > <xslo:value-of select="substring(., 1, 5)"/> > </z:index> >+ <z:index name="Record-status:w"> >+ <xslo:value-of select="substring(., 6, 1)"/> >+ </z:index> > <z:index name="rtype:w"> > <xslo:value-of select="substring(., 7, 1)"/> > </z:index> >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..b6f2fc0 100644 >--- a/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml >+++ b/etc/zebradb/marc_defs/unimarc/biblios/biblio-koha-indexdefs.xml >@@ -2,6 +2,9 @@ > <kohaidx:index_defs xmlns:kohaidx="http://www.koha-community.org/schemas/index-defs" > xmlns="http://www.koha-community.org/schemas/index-defs"> > <id>marc:controlfield[@tag='001']</id> >+ <index_leader offset="5" length="1"> >+ <target_index>Record-status:w</target_index> >+ </index_leader> > <!--record.abs line 24: melm 001 Local-number,Local-number:n--> > <index_control_field tag="001"> > <target_index>Local-number:w</target_index> >diff --git a/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl b/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl >index 32e1742..328eef2 100644 >--- a/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl >+++ b/etc/zebradb/marc_defs/unimarc/biblios/biblio-zebra-indexdefs.xsl >@@ -44,6 +44,11 @@ definition file (probably something like {biblio,authority}-koha-indexdefs.xml) > <xslo:apply-templates mode="index_all"/> > </z:record> > </xslo:template> >+ <xslo:template match="marc:leader"> >+ <z:index name="Record-status:w"> >+ <xslo:value-of select="substring(., 6, 1)"/> >+ </z:index> >+ </xslo:template> > <xslo:template match="marc:controlfield[@tag='001']"> > <z:index name="Local-number:w"> > <xslo:value-of select="."/> >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index bc703b3..fd9b169 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -571,6 +571,13 @@ if (C4::Context->preference('OpacSuppression')) { > } > } > >+# Hide records with Record-status=d >+if ( $query_type eq 'pqf' ) { >+ $query = '@not '.$query.' @attr 14=1 @attr 1=1046 d'; >+} else { >+ $query = "($query) not Record-status=d"; >+} >+ > $template->param ( LIMIT_INPUTS => \@limit_inputs ); > $template->param ( OPACResultsSidebar => C4::Context->preference('OPACResultsSidebar')); > >-- >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 15537
:
46508
|
46509
| 46510 |
46511