@@ -, +, @@
Observe that your record is found.
Observe that it is accessible. Copy the URL for later(!).
Observe that your record is not found.
Observe that you are redirected to opac-blocked and it displays a short standard message.
Observe that the text you entered in OpacSuppressionMessage is displayed under the standard text you have seen before.
Observe that you are redirected to Koha's 404 error page.
---
installer/data/mysql/sysprefs.sql | 2 +
installer/data/mysql/updatedatabase.pl | 9 +++++
.../en/modules/admin/preferences/cataloguing.pref | 11 +++++-
.../opac-tmpl/prog/en/modules/opac-blocked.tt | 32 ++++++++++++++++
opac/opac-blocked.pl | 38 ++++++++++++++++++++
opac/opac-detail.pl | 30 +++++++++++++++
6 files changed, 121 insertions(+), 1 deletions(-)
create mode 100644 koha-tmpl/opac-tmpl/prog/en/modules/opac-blocked.tt
create mode 100755 opac/opac-blocked.pl
--- a/installer/data/mysql/sysprefs.sql
+++ a/installer/data/mysql/sysprefs.sql
@@ -428,3 +428,5 @@ INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) V
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHoldNotes',0,'Show hold notes on OPAC','','YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', 'YesNo');
INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('AcqWarnOnDuplicateInvoice','0','Warn librarians when they try to create a duplicate invoice', '', 'YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacSuppressionRedirect','1','Redirect the opac detail page for suppressed records to an explanatory page (otherwise redirect to 404 error page)','','YesNo');
+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacSuppressionMessage','','Display this message on the redirect page for suppressed biblios','70|10','Textarea');
--- a/installer/data/mysql/updatedatabase.pl
+++ a/installer/data/mysql/updatedatabase.pl
@@ -7044,6 +7044,15 @@ if ( CheckVersion($DBversion) ) {
SetVersion($DBversion);
}
+$DBversion = "3.13.00.XXX";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacSuppressionRedirect','1','Redirect the opac detail page for suppressed records to an explanatory page (otherwise redirect to 404 error page)','','YesNo')");
+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OpacSuppressionMessage', '','Display this message on the redirect page for suppressed biblios','70|10','Textarea')");
+ print "Upgrade to $DBversion done (Bug 10195: Records hidden with OpacSuppression can still be accessed)\n";
+ SetVersion($DBversion);
+}
+
+
=head1 FUNCTIONS
=head2 TableExists($table)
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref
@@ -156,10 +156,19 @@ Cataloging:
yes: Hide
no: "Don't hide"
- items marked as suppressed from OPAC search results. Note that you must have the Suppress
index set up in Zebra and at least one suppressed item, or your searches will be broken.
- - Restrict the suppression to IP adresses outside of the IP range
+ -
Restrict the suppression to IP adresses outside of the IP range
- pref: OpacSuppressionByIPRange
class: short
- (Leave blank if not used. Define a range like 192.168.
.)
+ -
Redirect the opac detail page for suppressed records to
+ - pref: OpacSuppressionRedirect
+ choices:
+ yes: "an explanatory page ('This record is blocked')."
+ no: "the 404 error page ('Not found')."
+ -
Display the following message on the redirect page for suppressed biblios
+ - pref: OpacSuppressionMessage
+ type: textarea
+ class: code
-
- pref: SeparateHoldings
choices:
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-blocked.tt
+++ a/koha-tmpl/opac-tmpl/prog/en/modules/opac-blocked.tt
@@ -0,0 +1,32 @@
+[% USE Koha %]
+[% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Blocked
+[% INCLUDE 'doc-head-close.inc' %]
+
+
You are not authorized to view this record.
+ [% IF ( OpacSuppressionMessage ) %] +[% OpacSuppressionMessage %]
+