From 511545427773061d880835e214af79f28db533f0 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 19 Nov 2019 11:12:32 +0100 Subject: [PATCH] Bug 23721: Use basketgroup's name to name the CSV export file When exporting a basket group, the names of the files are different: * pdf => aqbasketgroup.name(.pdf) * csv => aqbasketgroup.id(.csv) Better to use basketgroup's name for consistency and readability Test plan: Create a basketgroup and export it in pdf and CSV. The name of the generated file must be the basketgroup's name suffixed by the extension. --- acqui/basketgroup.pl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/acqui/basketgroup.pl b/acqui/basketgroup.pl index cc3f9fcc48..ffa4ffb2aa 100755 --- a/acqui/basketgroup.pl +++ b/acqui/basketgroup.pl @@ -330,9 +330,10 @@ if ( $op eq "add" ) { # export a closed basketgroup in csv # my $basketgroupid = $input->param('basketgroupid'); + my $basketgroup = GetBasketgroup($basketgroupid); print $input->header( -type => 'text/csv', - -attachment => 'basketgroup' . $basketgroupid . '.csv', + -attachment => ( $basketgroup->{name} || $basketgroupid ) . '.csv' ); print GetBasketGroupAsCSV( $basketgroupid, $input ); exit; -- 2.11.0