Lines 41-47
use C4::Items qw( ModItemTransfer );
Link Here
|
41 |
use C4::Members::Messaging; |
41 |
use C4::Members::Messaging; |
42 |
use C4::Members; |
42 |
use C4::Members; |
43 |
use C4::Output qw( output_html_with_http_headers ); |
43 |
use C4::Output qw( output_html_with_http_headers ); |
44 |
use C4::Reserves qw( ModReserve ModReserveAffect GetOtherReserves ); |
44 |
use C4::Reserves qw( ModReserve ModReserveAffect CheckReserves ); |
45 |
use C4::RotatingCollections; |
45 |
use C4::RotatingCollections; |
46 |
use Koha::AuthorisedValues; |
46 |
use Koha::AuthorisedValues; |
47 |
use Koha::BiblioFrameworks; |
47 |
use Koha::BiblioFrameworks; |
Lines 162-176
if ( $query->param('reserve_id') && $op eq 'cud-affect_reserve') {
Link Here
|
162 |
} # FIXME else? |
162 |
} # FIXME else? |
163 |
} else { |
163 |
} else { |
164 |
my $diffBranchSend = ($userenv_branch ne $diffBranchReturned) ? $diffBranchReturned : undef; |
164 |
my $diffBranchSend = ($userenv_branch ne $diffBranchReturned) ? $diffBranchReturned : undef; |
|
|
165 |
|
165 |
# diffBranchSend tells ModReserveAffect whether document is expected in this library or not, |
166 |
# diffBranchSend tells ModReserveAffect whether document is expected in this library or not, |
166 |
# i.e., whether to apply waiting status |
167 |
# i.e., whether to apply waiting status |
167 |
ModReserveAffect( $itemnumber, $borrowernumber, $diffBranchSend, $reserve_id, $desk_id ); |
168 |
ModReserveAffect( $itemnumber, $borrowernumber, $diffBranchSend, $reserve_id, $desk_id ); |
|
|
169 |
|
170 |
if ($diffBranchSend) { |
171 |
ModItemTransfer( $itemnumber, $userenv_branch, $diffBranchSend, 'Reserve' ); |
172 |
} |
168 |
} |
173 |
} |
169 |
# check if we have other reserves for this document, if we have a return send the message of transfer |
174 |
# check if we have other reserves for this document, if we have a result send the message of transfer |
170 |
my ( $messages, $nextreservinfo ) = GetOtherReserves($itemnumber); |
175 |
# FIXME do we need to do this if we didn't take the cancel_reserve branch above? |
|
|
176 |
my ( undef, $nextreservinfo, undef ) = CheckReserves($item); |
171 |
|
177 |
|
172 |
my $patron = Koha::Patrons->find( $nextreservinfo ); |
178 |
my $patron = Koha::Patrons->find( $nextreservinfo->{'borrowernumber'} ); |
173 |
if ( $messages->{'transfert'} ) { |
179 |
if ( $userenv_branch ne $nextreservinfo->{'branchcode'} ) { |
174 |
$template->param( |
180 |
$template->param( |
175 |
itemtitle => $biblio->title, |
181 |
itemtitle => $biblio->title, |
176 |
itembiblionumber => $biblio->biblionumber, |
182 |
itembiblionumber => $biblio->biblionumber, |
Lines 595-609
if ( $messages->{'ResFound'} ) {
Link Here
|
595 |
|
601 |
|
596 |
my $diffBranchSend = !$branchCheck ? $reserve->{branchcode} : undef; |
602 |
my $diffBranchSend = !$branchCheck ? $reserve->{branchcode} : undef; |
597 |
ModReserveAffect( $itemnumber, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_id}, $desk_id ); |
603 |
ModReserveAffect( $itemnumber, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_id}, $desk_id ); |
598 |
my ( $messages, $nextreservinfo ) = GetOtherReserves($reserve->{itemnumber}); |
604 |
|
|
|
605 |
if ($diffBranchSend) { |
606 |
ModItemTransfer( $itemnumber, $item->holdingbranch, $reserve->{branchcode}, 'Reserve' ); |
607 |
} |
599 |
|
608 |
|
600 |
$template->param( |
609 |
$template->param( |
601 |
hold_auto_filled => 1, |
610 |
hold_auto_filled => 1, |
602 |
print_slip => C4::Context->preference('HoldsAutoFillPrintSlip'), |
611 |
print_slip => C4::Context->preference('HoldsAutoFillPrintSlip'), |
603 |
reserve_id => $nextreservinfo->{reserve_id}, |
612 |
reserve_id => $reserve->{reserve_id}, |
604 |
); |
613 |
); |
605 |
|
614 |
|
606 |
if ( $messages->{'transfert'} ) { |
615 |
if ($diffBranchSend) { |
607 |
$template->param( |
616 |
$template->param( |
608 |
itemtitle => $biblio->title, |
617 |
itemtitle => $biblio->title, |
609 |
itembiblionumber => $biblio->biblionumber, |
618 |
itembiblionumber => $biblio->biblionumber, |