From aa5eefd8285f65885325def875740ab2ceb07e2c Mon Sep 17 00:00:00 2001 From: Emmi Takkinen Date: Fri, 8 Mar 2024 13:47:16 +0200 Subject: [PATCH 04/14] 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 5d294db2ec..85117a42f6 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