From 4db0ba0269bf1cedae97059dfb90afac39dbd47c Mon Sep 17 00:00:00 2001 From: David Cook 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 @@ + @@ -89,7 +90,10 @@ Score - + + +
According to the MARC record leader, this record is deleted. It will not be visible in the OPAC.
+
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