From 2e71ba3c78c4a387aa45f388986b336743c6b135 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Thu, 14 Nov 2024 09:54:20 -0100 Subject: [PATCH] Bug 38441: ILLHistoryCheck: Staff UI --- ill/ill-requests.pl | 11 ++- .../prog/en/modules/ill/ill-requests.tt | 72 +++++++++++++++++++ 2 files changed, 82 insertions(+), 1 deletion(-) diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl index 37b2979ee8..b1f2233e60 100755 --- a/ill/ill-requests.pl +++ b/ill/ill-requests.pl @@ -30,6 +30,7 @@ use Koha::ILL::Requests; use Koha::ILL::Request; use Koha::ILL::Batches; use Koha::ILL::Request::Workflow::Availability; +use Koha::ILL::Request::Workflow::HistoryCheck; use Koha::ILL::Request::Workflow::TypeDisclaimer; use Koha::ILL::Request::Workflow::ConfirmAuto; use Koha::Libraries; @@ -134,6 +135,8 @@ if ( $backends_available ) { 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, 'staff' ); my $availability = Koha::ILL::Request::Workflow::Availability->new( $params, 'staff' ); my $type_disclaimer = @@ -141,8 +144,14 @@ if ( $backends_available ) { my $confirm_auto = Koha::ILL::Request::Workflow::ConfirmAuto->new( $params, 'staff' ); + # ILLHistoryCheck operation + if ($history_check->show_history_check($request)) { + $op = 'historycheck'; + $template->param( + $history_check->history_check_template_params($params) + ) # ILLCheckAvailability operation - if ($availability->show_availability($request)) { + } elsif ($availability->show_availability($request)) { $op = 'availability'; $template->param( $availability->availability_template_params($params) 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 f7dcade4fa..1fd6be5fb5 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 @@ -44,6 +44,13 @@ [% WRAPPER breadcrumb_item bc_active= 1 %] Request type disclaimer [% END %] + [% ELSIF op == 'historycheck' %] + [% WRAPPER breadcrumb_item %] + ILL requests + [% END %] + [% WRAPPER breadcrumb_item bc_active= 1 %] + Request history check + [% END %] [% ELSIF op == 'confirmautoill' %] [% WRAPPER breadcrumb_item %] ILL requests @@ -936,6 +943,71 @@ + [% ELSIF op == 'historycheck' %] + +

Request history check

+
+
+ [% INCLUDE 'csrf-token.inc' %] +

You are attempting to place the following request:

+ + [% FOREACH key IN whole.keys %] + [% value = whole.$key %] + [% IF key != 'op' && key != 'method' && key != 'custom_key' && key != 'custom_value' && key != 'csrf_token' && value %] + + + + + [% END %] + [% END %] +
[% key_mapping(key) || key | html %][% value | html %]
+   +

This interlibrary loan has been requested before:

+ [% IF matching_requests_for_patron.size %] +

By this patron [%- INCLUDE 'patron-title.inc' patron => request_patron_obj hide_patron_infos_if_needed => 1 -%]:

+ + [% END %] + [% IF remaining_matching_requests.size %] + [% IF matching_requests_for_patron.size %] +

By other patrons:

+ [% END %] + + [% END %] +
+ [% FOREACH key IN whole.keys %] + [% value = whole.$key %] + [% IF key != 'op' && key != 'method' && 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' %]

Confirm automatic request

-- 2.39.5