use Getopt::Long qw(:config no_ignore_case);
use C4::Context;
+use C4::Members::Attributes qw(GetBorrowerAttributes);
use Koha::Patrons;
binmode STDOUT, ":encoding(UTF-8)";
$0 -h
-f, --field=FIELD Field to export. It is repeatable and has to match
- column names of the borrower table (also as 'description' and 'category_type'
- If no field is specified, then all fields will be
- exported.
+ column names of the borrower table (with 'description',
+ 'category_type', and 'patron_attributes' also being
+ options). If no field is specified, then all fields
+ will be exported.
-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=\\;
my $member = $patron->unblessed;
$member->{description} = $category->description;
$member->{category_type} = $category->category_type;
+$member->{'patron_attributes'} = join (",", map { $_->{code}.":".$_->{value} } @{GetBorrowerAttributes($borrowernumber)});
@fields = keys %$member unless (@fields);
my $member = $patron->unblessed;
$member->{description} = $category->description;
$member->{category_type} = $category->category_type;
+ $member->{'patron_attributes'} = join (",", map { $_->{code}.":".$_->{value} } @{GetBorrowerAttributes($borrowernumber)});
$csv->combine(
map {
( defined $member->{$_} and !ref $member->{$_} )