diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm
index 9dfe275eff..980fce5bcd 100644
--- a/Koha/Illrequest.pm
+++ b/Koha/Illrequest.pm
@@ -41,6 +41,7 @@ use Koha::Biblios;
use Koha::Items;
use Koha::ItemTypes;
use Koha::Libraries;
+use Koha::AdditionalContents;
use C4::Circulation qw( CanBookBeIssued AddIssue );
@@ -932,9 +933,20 @@ sub backend_create {
my ( $self, $params ) = @_;
# Establish whether we need to do a generic copyright clearance.
- if ($params->{opac}) {
+ if ( $params->{opac} ) {
+
+ my $copyright_content = Koha::AdditionalContents->search_for_display(
+ {
+ category => 'html_customizations',
+ location => ['ILLModuleCopyrightClearance'],
+ lang => $params->{lang},
+ library_id => $params->{branchcode},
+ }
+ );
+
if ( ( !$params->{stage} || $params->{stage} eq 'init' )
- && C4::Context->preference("ILLModuleCopyrightClearance") ) {
+ && $copyright_content->count )
+ {
return {
error => 0,
status => '',
diff --git a/installer/data/mysql/atomicupdate/bug-35151-move-ILLModuleCopyrightClearance-to-additional-contents.pl b/installer/data/mysql/atomicupdate/bug-35151-move-ILLModuleCopyrightClearance-to-additional-contents.pl
new file mode 100755
index 0000000000..380e265e4e
--- /dev/null
+++ b/installer/data/mysql/atomicupdate/bug-35151-move-ILLModuleCopyrightClearance-to-additional-contents.pl
@@ -0,0 +1,41 @@
+use Modern::Perl;
+
+return {
+ bug_number => "35065",
+ description => "Move ILLModuleCopyrightClearance to additional contents",
+ up => sub {
+ my ($args) = @_;
+ my ( $dbh, $out ) = @$args{qw(dbh out)};
+
+ # Get any existing value from the ILLModuleCopyrightClearance system preference
+ my ($illmodulecopyrightclearance) = $dbh->selectrow_array(
+ q|
+ SELECT value FROM systempreferences WHERE variable='ILLModuleCopyrightClearance';
+ |
+ );
+ if ($illmodulecopyrightclearance) {
+
+ # Insert any values found from system preference into additional_contents
+ $dbh->do(
+ "INSERT INTO additional_contents ( category, code, location, branchcode, published_on ) VALUES ('html_customizations', 'ILLModuleCopyrightClearance', 'ILLModuleCopyrightClearance', NULL, CAST(NOW() AS date) )"
+ );
+
+ my ($insert_id) = $dbh->selectrow_array(
+ "SELECT id FROM additional_contents WHERE category = 'html_customizations' AND code = 'ILLModuleCopyrightClearance' AND location = 'ILLModuleCopyrightClearance' LIMIT 1",
+ {}
+ );
+
+ $dbh->do(
+ "INSERT INTO additional_contents_localizations ( additional_content_id, title, content, lang ) VALUES ( ?, 'ILLModuleCopyrightClearance default', ?, 'default' )",
+ undef, $insert_id, $illmodulecopyrightclearance
+ );
+
+ say $out "Added 'ILLModuleCopyrightClearance' HTML customization";
+ }
+
+ # Remove old system preference
+ $dbh->do("DELETE FROM systempreferences WHERE variable='ILLModuleCopyrightClearance'");
+ say $out "Removed system preference 'ILLModuleCopyrightClearance'";
+
+ },
+};
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc
index a6bb9f3109..2d9399f939 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc
+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc
@@ -18,6 +18,10 @@
Include this content in the popup message which is displayed in the OPAC when the CookieConsent system preference is enabled and the user clicks the "Your cookies" menu item in the header.
+
+ Adding content to this region will enable the copyright clearance stage in request creation. The content will appear on the OPAC during the process of placing an ILL request.
+
+
Include this content in the footer of all pages in the OPAC.
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt
index ad010de3b2..2edc683570 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt
@@ -526,7 +526,7 @@
[% END %]
[% END %]
[% ELSE %]
- [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'OpacMaintenanceNotice', 'OPACResultsSidebar', 'OpacSuppressionMessage', 'SCOMainUserBlock', 'SelfCheckInMainUserBlock', 'SelfCheckHelpMessage', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup', 'PatronSelfRegistrationAdditionalInstructions' ] %]
+ [% SET opac_available_options = [ 'OpacNavRight', 'opacheader', 'OpacCustomSearch', 'OpacMainUserBlock', 'opaccredits', 'OpacLoginInstructions', 'OpacNav', 'OpacNavBottom', 'OpacSuggestionInstructions', 'ArticleRequestsDisclaimerText', 'OpacMoreSearches', 'OpacMySummaryNote', 'OpacLibraryInfo', 'OpacMaintenanceNotice', 'OPACResultsSidebar', 'OpacSuppressionMessage', 'SCOMainUserBlock', 'SelfCheckInMainUserBlock', 'SelfCheckHelpMessage', 'CatalogConcernHelp', 'CatalogConcernTemplate', 'CookieConsentBar', 'CookieConsentPopup', 'PatronSelfRegistrationAdditionalInstructions', 'ILLModuleCopyrightClearance' ] %]