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.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
Jonathan Druart 2019-11-19 11:12:32 +01:00 committed by Martin Renvoize
parent d4589500d1
commit fbd46dd3a7
No known key found for this signature in database
GPG Key ID: 422B469130441A0F
1 changed files with 2 additions and 1 deletions

View File

@ -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;