From b58176aa785acf945d7596a68ea2bffcf1431601 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 14 Nov 2024 10:27:27 -0100 Subject: [PATCH] Bug 38441: ILLHistoryCheck: OPAC --- .../bootstrap/en/modules/opac-illrequests.tt | 38 +++++++++++++++++++ opac/opac-illrequests.pl | 18 ++++++++- 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt index 5636f66648..9500c77ac1 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt @@ -398,6 +398,44 @@ + [% ELSIF op == 'historycheck' %] +

Request history check

+
+ [% INCLUDE messages %] +
+ [%# This will get its name="op" value="cud-" from the loop over whole.keys below %] + [% INCLUDE 'csrf-token.inc' %] +

You have requested this interlibrary loan before:

+ [% IF matching_requests_for_patron.size %] + + [% END %] +
+ [% FOREACH key IN whole.keys %] + [% value = whole.$key %] + [% IF key != 'custom_key' && key != 'custom_value' && key != 'csrf_token' %] + + [% END %] + [% END %] + [% custom_keys = whole.custom_key.split('\0') %] + [% custom_values = whole.custom_value.split('\0') %] + [% i = 0 %] + [% FOREACH custom_key IN custom_keys %] + + + [% i = i + 1 %] + [% END %] + + + Cancel +
+
+
[% ELSIF op == 'confirmautoill' %]

Confirming automatic request

diff --git a/opac/opac-illrequests.pl b/opac/opac-illrequests.pl index d5c6c9e75f..0f078d81db 100755 --- a/opac/opac-illrequests.pl +++ b/opac/opac-illrequests.pl @@ -35,6 +35,7 @@ use Koha::Libraries; use Koha::Patrons; use Koha::ILL::Request::Workflow::Availability; use Koha::ILL::Request::Workflow::ConfirmAuto; +use Koha::ILL::Request::Workflow::HistoryCheck; use Koha::ILL::Request::Workflow::TypeDisclaimer; my $query = CGI->new; @@ -128,6 +129,8 @@ if ( $op eq 'list' ) { ->load_backend($params->{backend}); # Before request creation operations - Preparation + my $history_check = + Koha::ILL::Request::Workflow::HistoryCheck->new( $params, 'opac' ); my $availability = Koha::ILL::Request::Workflow::Availability->new( $params, 'opac' ); my $type_disclaimer = @@ -135,8 +138,18 @@ if ( $op eq 'list' ) { my $confirm_auto = Koha::ILL::Request::Workflow::ConfirmAuto->new( $params, 'opac' ); + # ILLHistoryCheck operation + if ($history_check->show_history_check($request)) { + $op = 'historycheck'; + $template->param( + $history_check->history_check_template_params($params) + ); + output_html_with_http_headers $query, $cookie, + $template->output, undef, + { force_no_caching => 1 }; + exit; # ILLCheckAvailability operation - if ($availability->show_availability($request)) { + } elsif ($availability->show_availability($request)) { $op = 'availability'; $template->param( $availability->availability_template_params($params) @@ -190,6 +203,9 @@ if ( $op eq 'list' ) { if ( $params->{type_disclaimer_submitted} ) { $type_disclaimer->after_request_created( $params, $request ); } + if ( C4::Context->preference('ILLHistoryCheck') ) { + $history_check->after_request_created( $params, $request ); + } if ( C4::Context->preference('ILLOpacUnauthenticatedRequest') && !$patron ) { $op = 'unauth_view'; } else { -- 2.39.5