Lines 139-157
my $confirm_required = 0;
Link Here
|
139 |
my $return_only = 0; |
139 |
my $return_only = 0; |
140 |
|
140 |
|
141 |
if ( $patron && $op eq "returnbook" && $allowselfcheckreturns ) { |
141 |
if ( $patron && $op eq "returnbook" && $allowselfcheckreturns ) { |
142 |
my $success = 0; |
142 |
my $success = 1; |
143 |
my $human_required = 0; |
143 |
|
|
|
144 |
|
144 |
my $item = Koha::Items->find( { barcode => $barcode } ); |
145 |
my $item = Koha::Items->find( { barcode => $barcode } ); |
145 |
if ( C4::Context->preference("CircConfirmItemParts") ) { |
146 |
if ( $success && C4::Context->preference("CircConfirmItemParts") ) { |
146 |
if ( defined($item) |
147 |
if ( defined($item) |
147 |
&& $item->materials ) |
148 |
&& $item->materials ) |
148 |
{ |
149 |
{ |
149 |
$human_required = 1; |
150 |
$success = 0; |
150 |
} |
151 |
} |
151 |
} |
152 |
} |
152 |
|
153 |
|
153 |
($success) = AddReturn( $barcode, $branch ) |
154 |
if ($success) { |
154 |
unless $human_required; |
155 |
# Patron cannot checkin an item they don't own |
|
|
156 |
$success = 0 |
157 |
unless $patron->checkouts->find( { itemnumber => $item->itemnumber } ); |
158 |
} |
159 |
|
160 |
if ( $success ) { |
161 |
($success) = AddReturn( $barcode, $branch ) |
162 |
} |
163 |
|
155 |
$template->param( returned => $success ); |
164 |
$template->param( returned => $success ); |
156 |
} |
165 |
} |
157 |
elsif ( $patron && ( $op eq 'checkout' ) ) { |
166 |
elsif ( $patron && ( $op eq 'checkout' ) ) { |
Lines 267-277
elsif ( $patron && ( $op eq 'checkout' ) ) {
Link Here
|
267 |
|
276 |
|
268 |
if ( $patron && ( $op eq 'renew' ) ) { |
277 |
if ( $patron && ( $op eq 'renew' ) ) { |
269 |
my $item = Koha::Items->find({ barcode => $barcode }); |
278 |
my $item = Koha::Items->find({ barcode => $barcode }); |
270 |
my ($status,$renewerror) = CanBookBeRenewed( $patron->borrowernumber, $item->itemnumber ); |
279 |
|
271 |
if ($status) { |
280 |
if ( $patron->checkouts->find( { itemnumber => $item->itemnumber } ) ) { |
272 |
AddRenewal( $patron->borrowernumber, $item->itemnumber, undef, undef, undef, undef, 1 ); |
281 |
my ($status,$renewerror) = CanBookBeRenewed( $patron->borrowernumber, $item->itemnumber ); |
273 |
push @newissueslist, $barcode; |
282 |
if ($status) { |
274 |
$template->param( renewed => 1 ); |
283 |
AddRenewal( $patron->borrowernumber, $item->itemnumber, undef, undef, undef, undef, 1 ); |
|
|
284 |
push @newissueslist, $barcode; |
285 |
$template->param( renewed => 1 ); |
286 |
} |
287 |
} else { |
288 |
$template->param( renewed => 0 ); |
275 |
} |
289 |
} |
276 |
} |
290 |
} |
277 |
|
291 |
|
278 |
- |
|
|