Bug 6285 strange order in CSV upload

uploading the circ overdues result in a csv with columns in a strange order
and not the order of the screen
This patch reorder the column by putting the usefull ones first

Signed-off-by: Magnus Enger <magnus@enger.priv.no>

Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Paul Poulain 2011-04-29 19:31:40 +02:00 committed by Chris Cormack
parent 16f1fffdd1
commit f6043fbbe4

View file

@ -398,7 +398,8 @@ sub build_csv {
my @lines = ();
# build header ...
my @keys = grep { $_ ne 'patron_attr_value_loop' } sort keys %{ $overdues->[0] };
my @keys = qw /duedate title author borrowertitle name phone barcode email address address2 zipcode city country
branchcode itemcallnumber biblionumber borrowernumber itemnum replacementprice streetnumber streettype/;
my $csv = Text::CSV_XS->new();
$csv->combine(@keys);
push @lines, $csv->string();