From aad3b5a3fc73e041abeaf335bd201089279bfb67 Mon Sep 17 00:00:00 2001 From: Emmi Takkinen Date: Thu, 17 Apr 2025 09:05:24 +0300 Subject: [PATCH] Bug 36135: Fix ability to send SQL results in batch modify holds tool Ability to send SQL results to batch holds tool was broken due use of API to fetch holds. This patch fixes this. To test: 1. Create SQL report which contains column for reserve_id. => e.g "SELECT reserve_id FROM reserves limit 10". 2. Run report. 3. Over report select "Batch operations" should be displayed and under that there should be option "Batch modify holds". 4. Click "Batch modify holds" option. => Confirm that holds displayed in "Batch mofidy holds" tool are same as found with your report. Note that when SQL results are send to the tool, search form is displayed for a second before API call is launched. This is expected behaviour since we need to first navigate to the search form so we can then trigger the forms submit event automatically. Also tidy some code to make QA tool happy. Sponsored-by: Koha-Suomi Oy --- .../modules/reports/guided_reports_start.tt | 19 ++++++++----------- .../en/modules/tools/batch_modify_holds.tt | 8 ++++++++ tools/batch_modify_holds.pl | 7 ++++++- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt index 9905099f8f..3ba46a40e9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -1070,17 +1070,14 @@ > -
- - [% FOREACH result IN results %] - [% FOREACH cells IN result.cells %] - [% place = loop.index %] - [% IF header_row.$place.cell == 'reserve_id' || header_types.item(header_row.$place.cell) == 'reserve_id' %] - [% SET batch_reserve_ids = 1 %] - - [% END %] - [% END %] - [% END %] + + [% INCLUDE 'csrf-token.inc' %] + +
[% BLOCK batch_list %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt index d1493f81a1..622dd1b84b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_modify_holds.tt @@ -195,6 +195,7 @@