@@ -, +, @@ --- misc/export_borrowers.pl | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/misc/export_borrowers.pl +++ a/misc/export_borrowers.pl @@ -43,7 +43,8 @@ $0 -h -f, --field=FIELD Field to export. It is repeatable and has to match keys returned by the GetMemberDetails function. If no field is specified, then all fields will be - exported. + exported. The field patron_attributes exports all + patron_attributes. -s, --separator=CHAR This character will be used to separate fields. Some characters like | or ; will need to be escaped in the parameter setting, like -s=\\| or -s=\\; @@ -100,6 +101,7 @@ my $csv = Text::CSV->new( { sep_char => $separator, binary => 1 } ); # We retrieve the first borrower informations to get field names my ($borrowernumber) = $sth->fetchrow_array or die "No borrower to export"; my $member = GetMemberDetails($borrowernumber); +$member->{'patron_attributes'} = join (",", map { $_->{code}.":".$_->{value} } @{GetBorrowerAttributes($borrowernumber)}); @fields = keys %$member unless (@fields); if ($show_header) { @@ -121,6 +123,7 @@ print $csv->string . "\n"; while ( my $borrowernumber = $sth->fetchrow_array ) { $member = GetMemberDetails($borrowernumber); + $member->{'patron_attributes'} = join (",", map { $_->{code}.":".$_->{value} } @{GetBorrowerAttributes($borrowernumber)}); $csv->combine( map { ( defined $member->{$_} and !ref $member->{$_} ) --