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($itemnumber); |
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 587-601
if ( $messages->{'ResFound'} ) {
Link Here
|
587 |
|
593 |
|
588 |
my $diffBranchSend = !$branchCheck ? $reserve->{branchcode} : undef; |
594 |
my $diffBranchSend = !$branchCheck ? $reserve->{branchcode} : undef; |
589 |
ModReserveAffect( $itemnumber, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_id}, $desk_id ); |
595 |
ModReserveAffect( $itemnumber, $reserve->{borrowernumber}, $diffBranchSend, $reserve->{reserve_id}, $desk_id ); |
590 |
my ( $messages, $nextreservinfo ) = GetOtherReserves($reserve->{itemnumber}); |
596 |
|
|
|
597 |
if ($diffBranchSend) { |
598 |
ModItemTransfer( $itemnumber, $item->holdingbranch, $reserve->{branchcode}, 'Reserve' ); |
599 |
} |
591 |
|
600 |
|
592 |
$template->param( |
601 |
$template->param( |
593 |
hold_auto_filled => 1, |
602 |
hold_auto_filled => 1, |
594 |
print_slip => C4::Context->preference('HoldsAutoFillPrintSlip'), |
603 |
print_slip => C4::Context->preference('HoldsAutoFillPrintSlip'), |
595 |
reserve_id => $nextreservinfo->{reserve_id}, |
604 |
reserve_id => $reserve->{reserve_id}, |
596 |
); |
605 |
); |
597 |
|
606 |
|
598 |
if ( $messages->{'transfert'} ) { |
607 |
if ($diffBranchSend) { |
599 |
$template->param( |
608 |
$template->param( |
600 |
itemtitle => $biblio->title, |
609 |
itemtitle => $biblio->title, |
601 |
itembiblionumber => $biblio->biblionumber, |
610 |
itembiblionumber => $biblio->biblionumber, |