Bug 37615: Clean up the form for sending cardnumbers from a report to batch patron modification

Since bug 37197 switched reports back to using a POST to send cardnumbers to
batch modification, we should also be using a single textarea rather than
multiple inputs.

Test plan:
1. Reports - Create from SQL - give it a name, and the SQL
   select cardnumber from borrowers limit 3
2. Save report - Run report
3. Batch operations with 3 visible records - Batch patron modification
4. Verify that you have the same three cardnumbers in Batch patron modification
   as were in the report.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Phil Ringnalda 2024-08-15 15:11:44 -07:00 committed by Katrin Fischer
parent 27d6f65662
commit f121beb689
Signed by: kfischer
GPG key ID: 0EF6E2C03357A834
2 changed files with 4 additions and 6 deletions

View file

@ -1012,10 +1012,10 @@
[%- END -%]
[%- cardnumbers = PROCESS batch_list results=results batch_type='cardnumber' | trim | html %]
[% IF !batch_borrowernumbers && cardnumbers %]
[% SET batch_cardnumbers = cardnumbers.length %]
[% FOR b IN cardnumbers.split("\n") %]
<input type="hidden" name="cardnumber" value="[% b | uri %]" />
[% END -%]
[% SET batch_cardnumbers = 1 %]
<textarea style="display:none;" name="cardnumberlist" id="cardnumberlist">
[%- cardnumbers | html -%]
</textarea>
[% END %]
</form>

View file

@ -66,8 +66,6 @@ if ( $op eq 'cud-show' ) {
if( my $cardnumberlist = $input->param('cardnumberlist') ){
# User submitted a list of card numbers
push @patronidnumbers, split( /\s\n/, $cardnumberlist );
} elsif ( my @cardnumbers = $input->multi_param('cardnumber') ) {
@patronidnumbers = @cardnumbers;
} elsif ( my $cardnumberuploadfile = $input->param('cardnumberuploadfile') ){
# User uploaded a file of card numbers
binmode $cardnumberuploadfile, ':encoding(UTF-8)';