Bugzilla – Attachment 41340 Details for
Bug 14493
export_borrowers.pl - Export patron attributes
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
export_borrowers.pl changed to support patron attributes
exportborrowerspl-changed-to-support-patron-attrib.patch (text/plain), 2.00 KB, created by
Vitor Fernandes
on 2015-08-04 12:17:54 UTC
(
hide
)
Description:
export_borrowers.pl changed to support patron attributes
Filename:
MIME Type:
Creator:
Vitor Fernandes
Created:
2015-08-04 12:17:54 UTC
Size:
2.00 KB
patch
obsolete
>From abca2500818fb12b08feb673623d7297de04de4f Mon Sep 17 00:00:00 2001 >From: Vitor Fernandes <vfernandes@keep.pt> >Date: Mon, 6 Jul 2015 12:22:28 +0100 >Subject: [PATCH] export_borrowers.pl changed to support patron attributes > >http://bugs.koha-community.org/show_bug.cgi?id=14493 >--- > misc/export_borrowers.pl | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > >diff --git a/misc/export_borrowers.pl b/misc/export_borrowers.pl >index 6f0985a..03f038e 100755 >--- a/misc/export_borrowers.pl >+++ b/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->{$_} ) >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14493
:
40802
|
41340
|
41341
|
76926
|
89574