From d83768eb3ed5d1346d32e565e0981c62fc6fa472 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, 54 insertions(+), 2 deletions(-) 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 dbe2760fe30..8197e543a85 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt @@ -384,6 +384,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 9527a532dcf..548fbf15630 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; @@ -124,12 +125,22 @@ if ( $op eq 'list' ) { my $request = Koha::ILL::Request->new->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 = Koha::ILL::Request::Workflow::TypeDisclaimer->new( $params, 'opac' ); my $confirm_auto = Koha::ILL::Request::Workflow::ConfirmAuto->new( $params, 'opac' ); - # ILLCheckAvailability operation - if ( $availability->show_availability($request) ) { + # 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 + } elsif ( $availability->show_availability($request) ) { $op = 'availability'; $template->param( $availability->availability_template_params($params) ); output_html_with_http_headers $query, $cookie, @@ -180,6 +191,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