From 46022d1eb37934dfe3fe0dc612fe2cd15789aa64 Mon Sep 17 00:00:00 2001 From: Emmi Takkinen Date: Fri, 8 Mar 2024 13:47:16 +0200 Subject: [PATCH 04/15] Bug 36135: Allow using SQL results in batch modify holds tool This patch adds ability to use SQL results for batch holds tool if report contains column reserve_id. 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. Sponsored-by: Koha-Suomi Oy Signed-off-by: Laura Escamilla Signed-off-by: Lucas Gass --- .../modules/reports/guided_reports_start.tt | 35 ++++++++++++++++--- 1 file changed, 31 insertions(+), 4 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 55afc39ff0..b4072c0af0 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 @@ -1067,6 +1067,19 @@ > +
+ + [% 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 %] +
+ [% BLOCK batch_list %] [%- FOREACH result IN results %] [%- FOREACH cells IN result.cells %] @@ -1091,9 +1104,9 @@ - [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_borrowernumbers ) || ( unlimited_total > 10 && limit <= 1000 ) %] + [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_borrowernumbers || batch_reserve_ids ) || ( unlimited_total > 10 && limit <= 1000 ) %]
- [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_borrowernumbers ) %] + [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_borrowernumbers || batch_reserve_ids ) %]
- [% END # /IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers ) %] + [% END # /IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_reserve_ids ) %] [% IF ( unlimited_total > 10 && limit <= 1000 ) %]
@@ -1234,7 +1261,7 @@
[% END # /IF ( unlimited_total > 10 && limit <= 1000 ) %] - [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers ) %] + [% IF ( batch_biblionumbers || batch_itemnumbers || batch_cardnumbers || batch_reserve_ids ) %] -- 2.34.1