From 43e7dd17d11a4077544f510353b5a52a35ebce44 Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 25 Jul 2024 17:52:03 +0000 Subject: [PATCH] Bug 37188: Allow batch modification of borrowers from reports with cardnumber or borrowernumber Some libraries do not use cardnumbers for their patrons, but would still like to be able to batch modify patrons from reports. Borrowernumber is going to be authoritative - every borrower will have one - so if this column is included in the results we should offer batch modification. If we have cardnumber, we can use that. If we have both, we should use borrowernumber To test: 1 - Write a report like: SELECT cardnumber FROM borrowers ORDER BY rand() LIMIT 35 2 - Run report 3 - Click "Batch operations.." -> "Batch patron modification" 4 - Confirm it works 5 - Edit report: SELECT borrowernumber FROM borrowers ORDER BY rand() LIMIT 35 6 - Run report 7 - No option for batch modifying patrons 8 - Apply patch 9 - Run report 10 - The option for batch modificatoin now shows 11 - Confirm both batch operation types work from report 12 - Edit report: SELECT cardnumber,borrowernumber FROM borrowers ORDER BY rand() LIMIT 35 13 - Run report 14 - Confirm both batch operations work Signed-off-by: Laura ONeil Signed-off-by: Pedro Amorim Signed-off-by: Katrin Fischer --- .../prog/en/modules/reports/guided_reports_start.tt | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 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 cb83a9eaf0..e1db08685a 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 @@ -1003,8 +1003,15 @@ [% INCLUDE 'csrf-token.inc' %] [% # Preserve the whitespace of the following textarea in order to format the values correctly %] + [%- borrowernumbers = PROCESS batch_list results=results batch_type='borrowernumber' | trim | html -%] + [%- IF borrowernumbers -%] + [%- SET batch_borrowernumbers = 1 -%] + + [%- END -%] [%- cardnumbers = PROCESS batch_list results=results batch_type='cardnumber' | trim | html %] - [% IF cardnumbers %] + [% IF !batch_borrowernumbers && cardnumbers %] [% SET batch_cardnumbers = cardnumbers.length %] [% FOR b IN cardnumbers.split("\n") %] @@ -1067,7 +1074,7 @@ [% END %] [% IF show_cardnumber_ops || show_borrowernumber_ops %] - [% IF show_cardnumber_ops %] + [% IF show_cardnumber_ops || show_borrowernumber_ops %]
  • Batch patron modification
  • -- 2.39.5