@@ -, +, @@ preference to additional contents - In the staff client, go to Tools -> HTML customizations and verify that the content from ILLModuleCopyrightClearance is now stored there. - The HTML customization entry form should offer ILLModuleCopyrightClearance as a choice under "Display location." - Update and reinstall active translations (for instance fr-FR): - perl misc/translator/translate update fr-FR - perl misc/translator/translate install fr-FR - Enable the translation if necessary under Administration -> System preferences -> language. - Enable the "opaclanguagesdisplay" preference if necessary. - Edit the ILLModuleCopyrightClearance HTML customization and add unique content to the "fr-FR" tab. - Enable the "ILLModule" and "ILLModuleUnmediated" system preferences if necessary. You must have at least one ILL backend installed. - Log into the OPAC and click the "Interlibrary loan requests" in the sidebar menu on the user summary page. - Click "Create new request." - You should be taken to a page with your ILLModuleCopyrightClearance content shown along with "Yes" and "No" buttons. - Clicking "Yes" should take you to the form for creating a new request. - Switch to your updated translation and confirm that the content appears correctly. - Remove all "ILLModuleCopyrightClearance" html customizations. Test the "Create new request" process in the OPAC again. - There should be no confirmation step before arriving at the form for creating a new ILL request. - Go to Administration -> System preferences and search for "ILLModuleCopyrightClearance." It should return no results. --- Koha/Illrequest.pm | 16 +++++++- ...pyrightClearance-to-additional-contents.pl | 41 +++++++++++++++++++ .../en/includes/html-customization-help.inc | 4 ++ .../en/modules/tools/additional-contents.tt | 2 +- .../bootstrap/en/modules/opac-illrequests.tt | 11 +++-- opac/opac-illrequests.pl | 6 ++- 6 files changed, 73 insertions(+), 7 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug-35151-move-ILLModuleCopyrightClearance-to-additional-contents.pl --- a/Koha/Illrequest.pm +++ a/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 => '', --- a/installer/data/mysql/atomicupdate/bug-35151-move-ILLModuleCopyrightClearance-to-additional-contents.pl +++ a/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'"; + + }, +}; --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html-customization-help.inc +++ a/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.
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/additional-contents.tt @@ -524,7 +524,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' ] %] [% FOREACH l IN opac_available_options.sort %] [% IF l == location %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt @@ -6,6 +6,7 @@ [% USE AdditionalContents %] [% SET OpacNav = AdditionalContents.get( location => "OpacNav", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] [% SET OpacNavBottom = AdditionalContents.get( location => "OpacNavBottom", lang => lang, library => logged_in_user.branchcode || default_branch, blocktitle => 0 ) %] +[% SET ILLModuleCopyrightClearance = AdditionalContents.get( location => "ILLModuleCopyrightClearance", lang => lang, library => logged_in_user.branchcode || default_branch ) %] [% INCLUDE 'doc-head-open.inc' %] Your interlibrary loan requests › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog [% INCLUDE 'doc-head-close.inc' %] @@ -78,13 +79,17 @@ [% INCLUDE messages %]

- [% Koha.Preference('ILLModuleCopyrightClearance') | $raw %] + [% IF ( ILLModuleCopyrightClearance ) %] +

+ [% PROCESS koha_news_block news => ILLModuleCopyrightClearance %] +
+ [% END %]

[% USE link_url = url('/cgi-bin/koha/opac-illrequests.pl', whole.value.other) %] Yes + class="btn btn-sm btn-primary"> Yes No + class="btn btn-sm btn-danger"> No
[% ELSE %] [% INCLUDE messages %] --- a/opac/opac-illrequests.pl +++ a/opac/opac-illrequests.pl @@ -146,8 +146,12 @@ if ( $op eq 'list' ) { exit; } + my $patron = Koha::Patrons->find( { borrowernumber => $loggedinuser } ); + $params->{cardnumber} = $patron->cardnumber; - $params->{opac} = 1; + $params->{branchcode} = $patron->branchcode; + $params->{opac} = 1; + $params->{lang} = C4::Languages::getlanguage($query); my $backend_result = $request->backend_create($params); # After creation actions --