Bugzilla – Attachment 46511 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 (follow-up)
Bug-15537---Hide-records-on-Leader-05--d-in-OPAC-f.patch (text/plain), 2.89 KB, created by
David Cook
on 2016-01-12 02:28:44 UTC
(
hide
)
Description:
Bug 15537 - Hide records on Leader 05 = d in OPAC (follow-up)
Filename:
MIME Type:
Creator:
David Cook
Created:
2016-01-12 02:28:44 UTC
Size:
2.89 KB
patch
obsolete
>From 4db0ba0269bf1cedae97059dfb90afac39dbd47c Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 12 Jan 2016 13:20:56 +1100 >Subject: [PATCH] Bug 15537 - Hide records on Leader 05 = d in OPAC (follow-up) > >This follow-up adds a warning message on the detail page in the staff client, >which says that the record will not appear in the OPAC. > >It also includes some logic in opac-detail.pl which prevents an OPAC >user from visiting it directly. > >Test Plan: > >Apply the patch. > >1) Visit a staff client page for a bib record with LDR05=d. >2) Note that there is a warning message saying that it will not be >visible in the OPAC >3) Visit the corresponding OPAC page for the bib record >4) Note that you get a redirect to a 404. >--- > .../intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl | 6 +++++- > opac/opac-detail.pl | 11 +++++++++++ > 2 files changed, 16 insertions(+), 1 deletion(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >index a2f7a0c..f6c9554 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -40,6 +40,7 @@ > </xsl:choose> > </xsl:variable> > <xsl:variable name="leader" select="marc:leader"/> >+ <xsl:variable name="leader5" select="substring($leader,6,1)"/> > <xsl:variable name="leader6" select="substring($leader,7,1)"/> > <xsl:variable name="leader7" select="substring($leader,8,1)"/> > <xsl:variable name="leader19" select="substring($leader,20,1)"/> >@@ -89,7 +90,10 @@ > <xsl:when test="$leader6='c' or $leader6='d'">Score</xsl:when> > </xsl:choose> > </xsl:variable> >- >+ <!-- Display alert if the record has been marked as deleted in the leader --> >+ <xsl:if test="$leader5='d'"> >+ <div id="leader-delete-alert" class="alert">According to the MARC record leader, this record is deleted. It will not be visible in the OPAC.</div> >+ </xsl:if> > <!-- Title Statement --> > <!-- Alternate Graphic Representation (MARC 880) --> > <xsl:if test="$display880"> >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 6d71bed..f1d13ad 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -91,6 +91,17 @@ if ( ! $record ) { > exit; > } > >+# redirect if biblio has LDR05=d >+my $leader = $record->leader(); >+if ($leader){ >+ my $ldr05 = substr($leader,5,1); >+ if ($ldr05 eq 'd'){ >+ my $ldr05_redirect = "/cgi-bin/koha/errors/404.pl"; >+ print $query->redirect($ldr05_redirect); >+ exit; >+ } >+} >+ > # redirect if opacsuppression is enabled and biblio is suppressed > if (C4::Context->preference('OpacSuppression')) { > # FIXME hardcoded; the suppression flag ought to be materialized >-- >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