Lines 56-82
if ($input->param('borrowernumber')) {
Link Here
|
56 |
my $logged_in_user = Koha::Patrons->find( $loggedinuser ); |
56 |
my $logged_in_user = Koha::Patrons->find( $loggedinuser ); |
57 |
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); |
57 |
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } ); |
58 |
|
58 |
|
59 |
my $order = 'date_due desc'; |
|
|
60 |
my $limit = 0; |
61 |
my $issues = (); |
62 |
# Do not request the old issues of anonymous patron |
63 |
if ( $patron->borrowernumber eq C4::Context->preference('AnonymousPatron') ){ |
64 |
# use of 'eq' in the above comparison is intentional -- the |
65 |
# system preference value could be blank |
66 |
$template->param( is_anonymous => 1 ); |
67 |
} else { |
68 |
$issues = GetAllIssues($patron->borrowernumber,$order,$limit); |
69 |
} |
70 |
|
71 |
# barcode export |
59 |
# barcode export |
72 |
if ( $op eq 'export_barcodes' ) { |
60 |
if ( $op eq 'export_barcodes' ) { |
73 |
# FIXME This should be moved out of this script |
61 |
# FIXME This should be moved out of this script |
74 |
if ( $patron->privacy < 2) { |
62 |
if ( $patron->privacy < 2) { |
75 |
my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }); |
63 |
my @barcodes = $patron->old_checkouts->search( {}, { prefetch => 'item' } ) |
76 |
my @barcodes = |
64 |
->filter_by_todays_checkins->get_column('item.barcode'); |
77 |
map { $_->{barcode} } grep { $_->{returndate} =~ m/^$today/o } @{$issues}; |
65 |
|
78 |
my $borrowercardnumber = $patron->cardnumber; |
66 |
my $borrowercardnumber = $patron->cardnumber; |
79 |
my $delimiter = "\n"; |
67 |
my $delimiter = "\n"; |
|
|
68 |
my $today = dt_from_string->ymd; |
80 |
binmode( STDOUT, ":encoding(UTF-8)" ); |
69 |
binmode( STDOUT, ":encoding(UTF-8)" ); |
81 |
print $input->header( |
70 |
print $input->header( |
82 |
-type => 'application/octet-stream', |
71 |
-type => 'application/octet-stream', |
Lines 90-95
if ( $op eq 'export_barcodes' ) {
Link Here
|
90 |
} |
79 |
} |
91 |
} |
80 |
} |
92 |
|
81 |
|
|
|
82 |
my $order = 'date_due desc'; |
83 |
my $limit = 0; |
84 |
my $issues = (); |
85 |
# Do not request the old issues of anonymous patron |
86 |
if ( $patron->borrowernumber eq C4::Context->preference('AnonymousPatron') ){ |
87 |
# use of 'eq' in the above comparison is intentional -- the |
88 |
# system preference value could be blank |
89 |
$template->param( is_anonymous => 1 ); |
90 |
} else { |
91 |
$issues = GetAllIssues($patron->borrowernumber,$order,$limit); |
92 |
} |
93 |
|
93 |
if (! $limit){ |
94 |
if (! $limit){ |
94 |
$limit = 'full'; |
95 |
$limit = 'full'; |
95 |
} |
96 |
} |
96 |
- |
|
|