Lines 340-345
foreach my $biblioNum (@biblionumbers) {
Link Here
|
340 |
|
340 |
|
341 |
$biblioLoopIter{itemLoop} = []; |
341 |
$biblioLoopIter{itemLoop} = []; |
342 |
my $numCopiesAvailable = 0; |
342 |
my $numCopiesAvailable = 0; |
|
|
343 |
# $canReserveMultiple is set to "yes" ( >0 ) if multiple items can be reserved |
344 |
# it is set to 0 otherwise. depends on item-level_itypes syspref |
345 |
# and the list of itypes that can be multiple reserved |
346 |
my $canReserveMultiple=0; |
347 |
unless (C4::Context->preference("item-level_itypes")) { |
348 |
$canReserveMultiple = CanHoldMultipleItems($biblioLoopIter{itemtype}); |
349 |
} |
343 |
foreach my $itemInfo (@{$biblioData->{itemInfos}}) { |
350 |
foreach my $itemInfo (@{$biblioData->{itemInfos}}) { |
344 |
my $itemNum = $itemInfo->{itemnumber}; |
351 |
my $itemNum = $itemInfo->{itemnumber}; |
345 |
my $itemLoopIter = {}; |
352 |
my $itemLoopIter = {}; |
Lines 354-359
foreach my $biblioNum (@biblionumbers) {
Link Here
|
354 |
$itemLoopIter->{description} = $itemInfo->{description}; |
361 |
$itemLoopIter->{description} = $itemInfo->{description}; |
355 |
$itemLoopIter->{imageurl} = $itemInfo->{imageurl}; |
362 |
$itemLoopIter->{imageurl} = $itemInfo->{imageurl}; |
356 |
} |
363 |
} |
|
|
364 |
# check if the itype is one that can be multiple reserved |
365 |
if (C4::Context->preference("item-level_itypes")) { |
366 |
# sum canReserveMultiple : if at least one item can be multiple reserved, then the flag will be >0 |
367 |
# FIXME : there can be complex & strange cases, where some items can be multiple reserved, and some can't |
368 |
# this case is not managed. Note it may be only theoric, and have no real case |
369 |
$canReserveMultiple = $canReserveMultiple+CanHoldMultipleItems($itemInfo->{itype}); |
370 |
} |
357 |
|
371 |
|
358 |
# If the holdingbranch is different than the homebranch, we show the |
372 |
# If the holdingbranch is different than the homebranch, we show the |
359 |
# holdingbranch of the document too. |
373 |
# holdingbranch of the document too. |
Lines 457-463
foreach my $biblioNum (@biblionumbers) {
Link Here
|
457 |
$biblioLoopIter{bib_available} = 1; |
471 |
$biblioLoopIter{bib_available} = 1; |
458 |
$biblioLoopIter{holdable} = 1; |
472 |
$biblioLoopIter{holdable} = 1; |
459 |
} |
473 |
} |
460 |
if ( $biblioLoopIter{already_reserved} && !CanHoldMultipleItems($biblioLoopIter{itemtype}) ) { |
474 |
if ( $biblioLoopIter{already_reserved} && !$canReserveMultiple ) { |
461 |
$biblioLoopIter{holdable} = undef; |
475 |
$biblioLoopIter{holdable} = undef; |
462 |
warn "Already_Reserved"; |
476 |
warn "Already_Reserved"; |
463 |
} |
477 |
} |
464 |
- |
|
|