Lines 1336-1356
sub ModReserveStatus {
Link Here
|
1336 |
|
1336 |
|
1337 |
=head2 ModReserveAffect |
1337 |
=head2 ModReserveAffect |
1338 |
|
1338 |
|
1339 |
&ModReserveAffect($itemnumber,$borrowernumber,$diffBranchSend); |
1339 |
&ModReserveAffect({ itemnumber => $itemnumber, borrowernumber => $borrowernumber, force_transfer => $diffBranchSend }); |
1340 |
|
1340 |
|
1341 |
This function affect an item and a status for a given reserve |
1341 |
This function affect an item and a status for a given reserve |
1342 |
The itemnumber parameter is used to find the biblionumber. |
1342 |
The itemnumber parameter is used to find the biblionumber. |
1343 |
with the biblionumber & the borrowernumber, we can affect the itemnumber |
1343 |
with the biblionumber & the borrowernumber, we can affect the itemnumber |
1344 |
to the correct reserve. |
1344 |
to the correct reserve. |
1345 |
|
1345 |
|
1346 |
if $transferToDo is not set, then the status is set to "Waiting" as well. |
1346 |
if $force_transfer is not set, then the status is set to "Waiting" as well. |
1347 |
otherwise, a transfer is on the way, and the end of the transfer will |
1347 |
otherwise, a transfer is on the way, and the end of the transfer will |
1348 |
take care of the waiting status |
1348 |
take care of the waiting status |
1349 |
|
1349 |
|
1350 |
=cut |
1350 |
=cut |
1351 |
|
1351 |
|
1352 |
sub ModReserveAffect { |
1352 |
sub ModReserveAffect { |
1353 |
my ( $itemnumber, $borrowernumber,$transferToDo ) = @_; |
1353 |
my ( $params ) = @_; |
|
|
1354 |
my $borrowernumber = $params->{borrowernumber}; |
1355 |
my $itemnumber = $params->{itemnumber}; |
1356 |
my $force_transfer = $params->{force_transfer}; |
1357 |
|
1354 |
my $dbh = C4::Context->dbh; |
1358 |
my $dbh = C4::Context->dbh; |
1355 |
|
1359 |
|
1356 |
# we want to attach $itemnumber to $borrowernumber, find the biblionumber |
1360 |
# we want to attach $itemnumber to $borrowernumber, find the biblionumber |
Lines 1371-1377
sub ModReserveAffect {
Link Here
|
1371 |
|
1375 |
|
1372 |
# If we affect a reserve that has to be transfered, don't set to Waiting |
1376 |
# If we affect a reserve that has to be transfered, don't set to Waiting |
1373 |
my $query; |
1377 |
my $query; |
1374 |
if ($transferToDo) { |
1378 |
if ( $force_transfer ) { |
1375 |
$query = " |
1379 |
$query = " |
1376 |
UPDATE reserves |
1380 |
UPDATE reserves |
1377 |
SET priority = 0, |
1381 |
SET priority = 0, |
Lines 1395-1402
sub ModReserveAffect {
Link Here
|
1395 |
} |
1399 |
} |
1396 |
$sth = $dbh->prepare($query); |
1400 |
$sth = $dbh->prepare($query); |
1397 |
$sth->execute( $itemnumber, $borrowernumber,$biblionumber); |
1401 |
$sth->execute( $itemnumber, $borrowernumber,$biblionumber); |
1398 |
_koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber ) if ( !$transferToDo && !$already_on_shelf ); |
1402 |
_koha_notify_reserve( $itemnumber, $borrowernumber, $biblionumber ) if ( !$force_transfer && !$already_on_shelf ); |
1399 |
_FixPriority( { biblionumber => $biblionumber } ); |
1403 |
_FixPriority( { biblionumber => $biblionumber } ); |
|
|
1404 |
|
1400 |
if ( C4::Context->preference("ReturnToShelvingCart") ) { |
1405 |
if ( C4::Context->preference("ReturnToShelvingCart") ) { |
1401 |
CartToShelf( $itemnumber ); |
1406 |
CartToShelf( $itemnumber ); |
1402 |
} |
1407 |
} |