|
Lines 58-64
my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in"
Link Here
|
| 58 |
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); |
58 |
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); |
| 59 |
|
59 |
|
| 60 |
my $order = 'date_due desc'; |
60 |
my $order = 'date_due desc'; |
| 61 |
my $limit = 0; |
61 |
my $limit = 0; # FIXME This variable is useless |
| 62 |
my $issues = (); |
62 |
my $issues = (); |
| 63 |
# Do not request the old issues of anonymous patron |
63 |
# Do not request the old issues of anonymous patron |
| 64 |
if ( $patron->borrowernumber eq C4::Context->preference('AnonymousPatron') ){ |
64 |
if ( $patron->borrowernumber eq C4::Context->preference('AnonymousPatron') ){ |
|
Lines 73-88
if ( $patron->borrowernumber eq C4::Context->preference('AnonymousPatron') ){
Link Here
|
| 73 |
if ( $op eq 'export_barcodes' ) { |
73 |
if ( $op eq 'export_barcodes' ) { |
| 74 |
# FIXME This should be moved out of this script |
74 |
# FIXME This should be moved out of this script |
| 75 |
if ( $patron->privacy < 2) { |
75 |
if ( $patron->privacy < 2) { |
| 76 |
my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); |
76 |
my $dt_today = dt_from_string; |
| 77 |
my @barcodes = |
77 |
my $todays_checkouts = $patron->todays_checkouts; |
| 78 |
map { $_->{barcode} } grep { $_->{returndate} =~ m/^$today/o } @{$issues}; |
78 |
my @barcodes = $todays_checkouts->get_column('item.barcode'); |
| 79 |
my $borrowercardnumber = $patron->cardnumber; |
|
|
| 80 |
my $delimiter = "\n"; |
79 |
my $delimiter = "\n"; |
| 81 |
binmode( STDOUT, ":encoding(UTF-8)" ); |
80 |
binmode( STDOUT, ":encoding(UTF-8)" ); |
| 82 |
print $input->header( |
81 |
print $input->header( |
| 83 |
-type => 'application/octet-stream', |
82 |
-type => 'application/octet-stream', |
| 84 |
-charset => 'utf-8', |
83 |
-charset => 'utf-8', |
| 85 |
-attachment => "$today-$borrowercardnumber-checkinexport.txt" |
84 |
-attachment => sprintf( |
|
|
85 |
"%s-%s-checkinexport.txt", |
| 86 |
output_pref({ dt => $dt_today, dateformat => 'iso', dateonly => 1 }), |
| 87 |
$patron->cardnumber |
| 88 |
), |
| 86 |
); |
89 |
); |
| 87 |
|
90 |
|
| 88 |
my $content = join $delimiter, uniq(@barcodes); |
91 |
my $content = join $delimiter, uniq(@barcodes); |
| 89 |
- |
|
|