From 6ffa223196985d0f6f8c9d939bc683cd6eec2929 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Fri, 27 Jun 2025 14:04:54 +0000 Subject: [PATCH] Bug 40262: Save and display copyrightclearance_confirmed Test plan, k-t-d: 1) Enable ILLModule 2) Add a new HTML customization, visit: /cgi-bin/koha/tools/additional-contents.pl?op=add_form&category=html_customizations&editmode=wysiwyg 3) Pick ILLModuleCopyrightClearance as the 'Display location' 4) Pick a 'Publication date' in the past 5) Add a title and content. Save. 6) Create a new ILL request in the OPAC, visit: /cgi-bin/koha/opac-illrequests.pl?op=add_form&backend=Standard 7) Notice the copyright clearance step is shown. Click 'Yes'. 8) Enter a 'type' and (optionally) some metadata. Click 'Create'. 9) Go back to the module in Staff UI and pick the request just created through the OPAC, visit: /cgi-bin/koha/ill/ill-requests.pl 10) Notice the message 'Patron has confirmed copyright clearance for this request' is shown next to the patron in the the request details Signed-off-by: David Nind --- Koha/ILL/Backend/Standard.pm | 2 +- Koha/ILL/Request.pm | 3 ++- .../intranet-tmpl/prog/en/modules/ill/ill-requests.tt | 4 ++++ .../en/includes/ill/backends/Standard/create.inc | 3 +++ opac/opac-illrequests.pl | 8 ++++++++ 5 files changed, 18 insertions(+), 2 deletions(-) diff --git a/Koha/ILL/Backend/Standard.pm b/Koha/ILL/Backend/Standard.pm index 444c0074d9..4deb9a09d6 100644 --- a/Koha/ILL/Backend/Standard.pm +++ b/Koha/ILL/Backend/Standard.pm @@ -149,7 +149,7 @@ sub metadata { my $metadata = {}; my @ignore = ( 'requested_partners', 'type', 'type_disclaimer_value', 'type_disclaimer_date', 'unauthenticated_first_name', - 'unauthenticated_last_name', 'unauthenticated_email', 'historycheck_requests' + 'unauthenticated_last_name', 'unauthenticated_email', 'historycheck_requests', 'copyrightclearance_confirmed' ); my $core_fields = _get_core_fields(); while ( my $attr = $attrs->next ) { diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm index 9b151e3924..ccc41a0e7c 100644 --- a/Koha/ILL/Request.pm +++ b/Koha/ILL/Request.pm @@ -1084,7 +1084,8 @@ sub backend_create { } elsif ( defined $params->{stage} && $params->{stage} eq 'copyrightclearance' ) { - $params->{stage} = 'init'; + $params->{copyrightclearance_confirmed} = 1; + $params->{stage} = 'init'; } } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt index 26ba077ed9..d958b0b8e3 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt @@ -606,6 +606,10 @@ Patron: [% borrowerlink = "/cgi-bin/koha/members/moremember.pl" _ "?borrowernumber=" _ request.patron.borrowernumber %] [% request.patron.firstname _ " " _ request.patron.surname _ " [" _ request.patron.cardnumber _ "]" | html %] + [% copyrightclearance_confirmed = request.extended_attributes.find({'type'=>'copyrightclearance_confirmed'}).value %] + [% IF copyrightclearance_confirmed %] + Patron has confirmed copyright clearance for this request + [% END %] [% END %] [% IF request.biblio_id %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/create.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/create.inc index 4ef7691762..1fb4d3df9b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/create.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/ill/backends/Standard/create.inc @@ -124,6 +124,9 @@ Cancel + [% IF (whole.value.other.copyrightclearance_confirmed) %] + + [% END %] diff --git a/opac/opac-illrequests.pl b/opac/opac-illrequests.pl index 27b853a64f..8c3e9b4b31 100755 --- a/opac/opac-illrequests.pl +++ b/opac/opac-illrequests.pl @@ -230,6 +230,14 @@ if ( $op eq 'list' ) { $session->flush; print $query->redirect('/cgi-bin/koha/opac-illrequests-unauthenticated.pl'); } else { + $request->extended_attributes( + [ + { + type => 'copyrightclearance_confirmed', + value => 1, + } + ] + ) if $params->{copyrightclearance_confirmed}; print $query->redirect('/cgi-bin/koha/opac-illrequests.pl?message=2'); exit; } -- 2.39.5