From ffdba84e7225694de5fde65d79ab1c334e999d9e 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 Signed-off-by: Edith Speller Sponsored-by: UKHSA (UK Health Security Agency) Signed-off-by: Tomas Cohen Arazi --- 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 a668b259791..9912bc7f167 100755 --- a/ill/ill-requests.pl +++ b/ill/ill-requests.pl @@ -556,8 +556,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 f8ffd703ca9..a0cff46abca 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 @@ -73,6 +73,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 87d73fc747c..74ab52b965c 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 @@ -913,6 +913,7 @@ [% INCLUDE 'select2.inc' %] [% IF metadata_enrichment_services %]