From 11bb5fb204c31e697273df43be0cb66bbbbce0f3 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 Signed-off-by: Lisette Scheer --- ill/ill-requests.pl | 11 ++- .../prog/en/modules/ill/ill-requests.tt | 67 +++++++++++++++++++ 2 files changed, 76 insertions(+), 2 deletions(-) diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl index 5902a688837..79ddc5eb285 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; @@ -133,12 +134,18 @@ 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 = Koha::ILL::Request::Workflow::TypeDisclaimer->new( $params, 'staff' ); my $confirm_auto = Koha::ILL::Request::Workflow::ConfirmAuto->new( $params, 'staff' ); - # 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) ) + + # ILLCheckAvailability operation + } 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 53c2a1eac9b..e6b12ed27d7 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 @@ -61,6 +61,8 @@ Request type disclaimer [% ELSIF op == 'confirmautoill' %] Confirm automatic request + [% ELSIF op == 'historycheck' %] + Request history check [% END %] [% END %] [% END #/ WRAPPER breadcrumbs %] @@ -858,6 +860,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