Lines 28-34
use CGI;
Link Here
|
28 |
use C4::Auth; |
28 |
use C4::Auth; |
29 |
use C4::Output; |
29 |
use C4::Output; |
30 |
use C4::Members; |
30 |
use C4::Members; |
31 |
use C4::Branch; |
31 |
use C4::Branch qw(GetBranches); |
32 |
use List::MoreUtils qw/any uniq/; |
32 |
use List::MoreUtils qw/any uniq/; |
33 |
use Koha::DateUtils; |
33 |
use Koha::DateUtils; |
34 |
|
34 |
|
Lines 62-105
if ($input->param('borrowernumber')) {
Link Here
|
62 |
|
62 |
|
63 |
my $order = 'date_due desc'; |
63 |
my $order = 'date_due desc'; |
64 |
my $limit = 0; |
64 |
my $limit = 0; |
65 |
my ( $issues ) = GetAllIssues($borrowernumber,$order,$limit); |
65 |
my $issues = GetAllIssues($borrowernumber,$order,$limit); |
66 |
|
66 |
|
67 |
my @loop_reading; |
67 |
my $branches = GetBranches(); |
68 |
my @barcodes; |
68 |
foreach my $issue ( @{$issues} ) { |
69 |
my $today = C4::Dates->new(); |
69 |
$issue->{issuingbranch} = $branches->{ $issue->{branchcode} }->{branchname}; |
70 |
$today = $today->output("iso"); |
|
|
71 |
|
72 |
foreach my $issue (@{$issues}){ |
73 |
my %line; |
74 |
$line{issuestimestamp} = format_date($issue->{'issuestimestamp'}); |
75 |
$line{biblionumber} = $issue->{'biblionumber'}; |
76 |
$line{title} = $issue->{'title'}; |
77 |
$line{author} = $issue->{'author'}; |
78 |
$line{classification} = $issue->{'classification'} || $issue->{'itemcallnumber'}; |
79 |
$line{date_due} = format_sqldatetime($issue->{date_due}); |
80 |
$line{returndate} = format_sqldatetime($issue->{returndate}); |
81 |
$line{issuedate} = format_sqldatetime($issue->{issuedate}); |
82 |
$line{issuingbranch} = GetBranchName($issue->{'branchcode'}); |
83 |
$line{renewals} = $issue->{'renewals'}; |
84 |
$line{barcode} = $issue->{'barcode'}; |
85 |
$line{volumeddesc} = $issue->{'volumeddesc'}; |
86 |
push(@loop_reading,\%line); |
87 |
my $return_dt = Koha::DateUtils::dt_from_string($issue->{'returndate'}, 'iso'); |
88 |
if ( ( $input->param('op') eq 'export_barcodes' ) and ( $today eq $return_dt->ymd() ) ) { |
89 |
push( @barcodes, $issue->{'barcode'} ); |
90 |
} |
91 |
} |
70 |
} |
92 |
|
71 |
|
93 |
if ($input->param('op') eq 'export_barcodes') { |
72 |
# barcode export |
94 |
my $borrowercardnumber = GetMember( borrowernumber => $borrowernumber )->{'cardnumber'} ; |
73 |
if ( $input->param('op') eq 'export_barcodes' ) { |
|
|
74 |
my $today = C4::Dates->new(); |
75 |
$today = $today->output('iso'); |
76 |
my @barcodes = |
77 |
map { $_->{barcode} } grep { $_->{returndate} =~ m/^$today/o } @{$issues}; |
78 |
my $borrowercardnumber = |
79 |
GetMember( borrowernumber => $borrowernumber )->{'cardnumber'}; |
95 |
my $delimiter = "\n"; |
80 |
my $delimiter = "\n"; |
96 |
binmode( STDOUT, ":encoding(UTF-8)"); |
81 |
binmode( STDOUT, ":encoding(UTF-8)" ); |
97 |
print $input->header( |
82 |
print $input->header( |
98 |
-type => 'application/octet-stream', |
83 |
-type => 'application/octet-stream', |
99 |
-charset => 'utf-8', |
84 |
-charset => 'utf-8', |
100 |
-attachment => "$today-$borrowercardnumber-checkinexport.txt" |
85 |
-attachment => "$today-$borrowercardnumber-checkinexport.txt" |
101 |
); |
86 |
); |
102 |
my $content = join($delimiter, uniq(@barcodes)); |
87 |
my $content = join $delimiter, uniq(@barcodes); |
103 |
print $content; |
88 |
print $content; |
104 |
exit; |
89 |
exit; |
105 |
} |
90 |
} |
Lines 116-121
if (! $limit){
Link Here
|
116 |
$limit = 'full'; |
101 |
$limit = 'full'; |
117 |
} |
102 |
} |
118 |
|
103 |
|
|
|
104 |
|
119 |
my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); |
105 |
my ($picture, $dberror) = GetPatronImage($data->{'cardnumber'}); |
120 |
$template->param( picture => 1 ) if $picture; |
106 |
$template->param( picture => 1 ) if $picture; |
121 |
|
107 |
|
Lines 128-163
if (C4::Context->preference('ExtendedPatronAttributes')) {
Link Here
|
128 |
} |
114 |
} |
129 |
|
115 |
|
130 |
$template->param( |
116 |
$template->param( |
131 |
readingrecordview => 1, |
117 |
readingrecordview => 1, |
132 |
biblionumber => $data->{'biblionumber'}, |
118 |
title => $data->{title}, |
133 |
title => $data->{'title'}, |
119 |
initials => $data->{initials}, |
134 |
initials => $data->{'initials'}, |
120 |
surname => $data->{surname}, |
135 |
surname => $data->{'surname'}, |
121 |
othernames => $data->{othernames}, |
136 |
othernames => $data->{'othernames'}, |
122 |
borrowernumber => $borrowernumber, |
137 |
borrowernumber => $borrowernumber, |
123 |
firstname => $data->{firstname}, |
138 |
limit => $limit, |
124 |
cardnumber => $data->{cardnumber}, |
139 |
firstname => $data->{'firstname'}, |
125 |
categorycode => $data->{categorycode}, |
140 |
cardnumber => $data->{'cardnumber'}, |
126 |
category_type => $data->{category_type}, |
141 |
categorycode => $data->{'categorycode'}, |
127 |
categoryname => $data->{description}, |
142 |
category_type => $data->{'category_type'}, |
128 |
address => $data->{address}, |
143 |
# category_description => $data->{'description'}, |
129 |
address2 => $data->{address2}, |
144 |
categoryname => $data->{'description'}, |
130 |
city => $data->{city}, |
145 |
address => $data->{'address'}, |
131 |
state => $data->{state}, |
146 |
address2 => $data->{'address2'}, |
132 |
zipcode => $data->{zipcode}, |
147 |
city => $data->{'city'}, |
133 |
country => $data->{country}, |
148 |
state => $data->{'state'}, |
134 |
phone => $data->{phone}, |
149 |
zipcode => $data->{'zipcode'}, |
135 |
email => $data->{email}, |
150 |
country => $data->{'country'}, |
136 |
branchcode => $data->{branchcode}, |
151 |
phone => $data->{'phone'}, |
137 |
is_child => ( $data->{category_type} eq 'C' ), |
152 |
email => $data->{'email'}, |
138 |
branchname => $branches->{ $data->{branchcode} }->{branchname}, |
153 |
branchcode => $data->{'branchcode'}, |
139 |
loop_reading => $issues, |
154 |
is_child => ($data->{'category_type'} eq 'C'), |
140 |
activeBorrowerRelationship => |
155 |
branchname => GetBranchName($data->{'branchcode'}), |
141 |
( C4::Context->preference('borrowerRelationship') ne '' ), |
156 |
showfulllink => (scalar @loop_reading > 50), |
|
|
157 |
loop_reading => \@loop_reading, |
158 |
activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''), |
159 |
); |
142 |
); |
160 |
output_html_with_http_headers $input, $cookie, $template->output; |
143 |
output_html_with_http_headers $input, $cookie, $template->output; |
161 |
|
144 |
|
162 |
|
|
|
163 |
|