From 5f288af84f2abcb8e7076e4ef81338fdf6e08650 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Fri, 14 Jul 2023 15:46:56 +0000 Subject: [PATCH] Bug 34282: Fix availability check in ILL batches Staging modal area had issues listing availability checks for each request in the batch creation process To test: 1) Run bash <(curl -s https://raw.githubusercontent.com/ammopt/koha-ill-dev/master/start-ill-dev-plus.sh) 2) Install a metadata enrichment plugin, e.g. https://github.com/PTFS-Europe/koha-plugin-api-pubmed/releases 3) Install and configure an availability plugin, e.g. eds https://github.com/PTFS-Europe/koha-plugin-ill-avail-eds/releases 4) Enable ILLCheckAvailability sys pref 5) Create a new ILL batch and input some pubmedids, i.e. 34898594, 31452466 6) Verify that the availability results show and are working, for each request in the batch --- ill/ill-requests.pl | 7 +- .../prog/en/includes/ill-batch-modal.inc | 3 + .../prog/en/modules/ill/ill-requests.tt | 1 + .../intranet-tmpl/prog/js/ill-batch-modal.js | 71 +++++++++++++------ 4 files changed, 55 insertions(+), 27 deletions(-) diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl index c10bfa5caf..a1842fec4e 100755 --- a/ill/ill-requests.pl +++ b/ill/ill-requests.pl @@ -323,6 +323,7 @@ if ( $backends_available ) { # Prepare availability searching, if required # Get the definition for the z39.50 plugin if ( C4::Context->preference('ILLCheckAvailability') ) { + # FIXME: the below get_services call is bugged, needs to be updated my $availability = Koha::Illrequest::Workflow::Availability->new($request->metadata); my $services = $availability->get_services({ ui_context => 'partners', @@ -553,8 +554,6 @@ sub get_ill_availability { } } - my $availability = Koha::Illrequest::Workflow::Availability->new($id_types); - return $availability->get_services({ - ui_context => 'staff' - }); + my $availability = Koha::Illrequest::Workflow::Availability->new($id_types, 'staff'); + return $availability->get_services(); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-batch-modal.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/ill-batch-modal.inc index 72903bb48d..9d60711576 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/ill-batch-modal.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/ill-batch-modal.inc @@ -72,6 +72,9 @@ Metadata Request ID Request Status + [% IF Koha.Preference('ILLCheckAvailability') %] + Availability + [% END %] 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 e2af162d83..faa9343030 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 @@ -909,6 +909,7 @@ [% INCLUDE 'select2.inc' %] [% IF metadata_enrichment_services %]