Bugzilla – Attachment 89574 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]
Bug 14493: export_borrowers.pl - Export patron attributes
Bug-14493-exportborrowerspl---Export-patron-attrib.patch (text/plain), 2.53 KB, created by
Maryse Simard
on 2019-05-10 21:04:41 UTC
(
hide
)
Description:
Bug 14493: export_borrowers.pl - Export patron attributes
Filename:
MIME Type:
Creator:
Maryse Simard
Created:
2019-05-10 21:04:41 UTC
Size:
2.53 KB
patch
obsolete
>From 7c22b2aebfc6452a9f54d04526d4978082cd4e57 Mon Sep 17 00:00:00 2001 >From: Vitor Fernandes <vfernandes@keep.pt> >Date: Thu, 12 Jul 2018 15:17:38 -0400 >Subject: [PATCH] Bug 14493: export_borrowers.pl - Export patron attributes > >Tweaked Vitor's original patch to accomodate changes to the file. > >Signed-off-by: Maryse Simard <maryse.simard@inlibro.com> >--- > misc/export_borrowers.pl | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) > >diff --git a/misc/export_borrowers.pl b/misc/export_borrowers.pl >index 4733c3c..5f8e10f 100755 >--- a/misc/export_borrowers.pl >+++ b/misc/export_borrowers.pl >@@ -25,6 +25,7 @@ use Getopt::Long qw(:config no_ignore_case); > > use Koha::Script; > use C4::Context; >+use C4::Members::Attributes qw(GetBorrowerAttributes); > use Koha::Patrons; > > binmode STDOUT, ":encoding(UTF-8)"; >@@ -42,9 +43,10 @@ $0 [--field=FIELD [--field=FIELD [...]]] [--separator=CHAR] [--show-header] [--w > $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=\\; >@@ -106,6 +108,7 @@ my $category = $patron->category; > 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); > >@@ -132,6 +135,7 @@ while ( my $borrowernumber = $sth->fetchrow_array ) { > 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->{$_} ) >-- >2.7.4
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