From a8402a02b0fef5a065cf595e5e986c5f86f8f7c1 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 | 6 +- .../prog/en/includes/ill-batch-modal.inc | 3 + .../prog/en/modules/ill/ill-requests.tt | 1 + .../intranet-tmpl/prog/js/ill-batch-modal.js | 118 ++++++++++-------- 4 files changed, 71 insertions(+), 57 deletions(-) diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl index c10bfa5caf..33fa2ca5f7 100755 --- a/ill/ill-requests.pl +++ b/ill/ill-requests.pl @@ -553,8 +553,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 3c3659eba3..213bba0d86 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 @@ -910,6 +910,7 @@ [% INCLUDE 'select2.inc' %] [% IF metadata_enrichment_services %]