Lines 181-186
if ($multihold) {
Link Here
|
181 |
my $itemdata_enumchron = 0; |
181 |
my $itemdata_enumchron = 0; |
182 |
my @biblioloop = (); |
182 |
my @biblioloop = (); |
183 |
my $not_all_holdable_onloan; |
183 |
my $not_all_holdable_onloan; |
|
|
184 |
my %pickplaces; |
185 |
my @itembrlist; |
186 |
my $itembranchesloop; |
184 |
foreach my $biblionumber (@biblionumbers) { |
187 |
foreach my $biblionumber (@biblionumbers) { |
185 |
|
188 |
|
186 |
my %biblioloopiter = (); |
189 |
my %biblioloopiter = (); |
Lines 306-311
foreach my $biblionumber (@biblionumbers) {
Link Here
|
306 |
$item->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $item->{itype} }{imageurl} ); |
309 |
$item->{imageurl} = getitemtypeimagelocation( 'intranet', $itemtypes->{ $item->{itype} }{imageurl} ); |
307 |
$item->{homebranchname} = $branches->{ $item->{homebranch} }{branchname}; |
310 |
$item->{homebranchname} = $branches->{ $item->{homebranch} }{branchname}; |
308 |
|
311 |
|
|
|
312 |
if( !$item->{notforloan} and !$item->{lost} and !$item->{withdrawn} and !$item->{damaged} ) { |
313 |
push @itembrlist, {'itemnumber' => $itemnumber,'brcode' => $item->{homebranch},'brname' => $item->{homebranchname}}; |
314 |
} |
309 |
# if the holdingbranch is different than the homebranch, we show the |
315 |
# if the holdingbranch is different than the homebranch, we show the |
310 |
# holdingbranch of the document too |
316 |
# holdingbranch of the document too |
311 |
if ( $item->{homebranch} ne $item->{holdingbranch} ) { |
317 |
if ( $item->{homebranch} ne $item->{holdingbranch} ) { |
Lines 415-420
foreach my $biblionumber (@biblionumbers) {
Link Here
|
415 |
) |
421 |
) |
416 |
{ |
422 |
{ |
417 |
$item->{available} = 1; |
423 |
$item->{available} = 1; |
|
|
424 |
$pickplaces{$item->{'homebranch'}}=$item->{'homebranchname'}; |
418 |
$num_available++ unless $not_all_holdable_onloan; |
425 |
$num_available++ unless $not_all_holdable_onloan; |
419 |
} |
426 |
} |
420 |
elsif ( C4::Context->preference('AllowHoldPolicyOverride') ) { |
427 |
elsif ( C4::Context->preference('AllowHoldPolicyOverride') ) { |
Lines 454-459
foreach my $biblionumber (@biblionumbers) {
Link Here
|
454 |
push @bibitemloop, $biblioitem; |
461 |
push @bibitemloop, $biblioitem; |
455 |
} |
462 |
} |
456 |
|
463 |
|
|
|
464 |
if ( C4::Context->preference('PickupHoldOnlyFromItemBranches') ){ |
465 |
$template->param( PickupHoldOnlyFromItemBranches => 1 ); |
466 |
$pickplaces{'any'}='' if scalar(keys %pickplaces) > 1; |
467 |
%pickplaces = {} if $not_all_holdable_onloan; |
468 |
$itembranchesloop = GetBranchesPartLoop(\%pickplaces); |
469 |
} |
457 |
# existingreserves building |
470 |
# existingreserves building |
458 |
my @reserveloop; |
471 |
my @reserveloop; |
459 |
( $count, $reserves ) = GetReservesFromBiblionumber($biblionumber,1); |
472 |
( $count, $reserves ) = GetReservesFromBiblionumber($biblionumber,1); |
Lines 530-535
foreach my $biblionumber (@biblionumbers) {
Link Here
|
530 |
|
543 |
|
531 |
if ( C4::Context->preference('IndependentBranches') && $flags->{'superlibrarian'} != 1 ) { |
544 |
if ( C4::Context->preference('IndependentBranches') && $flags->{'superlibrarian'} != 1 ) { |
532 |
$reserve{'branchloop'} = [ GetBranchDetail($res->{'branchcode'}) ]; |
545 |
$reserve{'branchloop'} = [ GetBranchDetail($res->{'branchcode'}) ]; |
|
|
546 |
} elsif (C4::Context->preference('PickupHoldOnlyFromItemBranches') ) { |
547 |
$res->{'branchcode'}||='any'; |
548 |
my %brlist; |
549 |
foreach ( @itembrlist ) { |
550 |
my $canreserve = CanItemBeReserved( $reserve{'borrowernumber'},$_->{'itemnumber'} ); |
551 |
if ( !defined($canreserve) or $canreserve > 0 ){ # this to get the itembranch on location list even if the item is not any more on loan (return=undef) |
552 |
$brlist{$_->{'brcode'}} = $_->{'brname'}; |
553 |
} |
554 |
} |
555 |
$brlist{'any'} = '' if scalar(keys %brlist) > 1; |
556 |
$reserve{'branchloop'}=GetBranchesPartLoop(\%brlist,$res->{'branchcode'}); |
533 |
} else { |
557 |
} else { |
534 |
$reserve{'branchloop'} = GetBranchesLoop($res->{'branchcode'}); |
558 |
$reserve{'branchloop'} = GetBranchesLoop($res->{'branchcode'}); |
535 |
} |
559 |
} |
Lines 541-551
foreach my $biblionumber (@biblionumbers) {
Link Here
|
541 |
my $time = time(); |
565 |
my $time = time(); |
542 |
|
566 |
|
543 |
$template->param( |
567 |
$template->param( |
544 |
branchloop => GetBranchesLoop($userbranch), |
568 |
branchloop => $itembranchesloop ? $itembranchesloop : GetBranchesLoop($userbranch), |
545 |
time => $time, |
569 |
time => $time, |
546 |
fixedRank => $fixedRank, |
570 |
fixedRank => $fixedRank, |
547 |
); |
571 |
); |
548 |
|
|
|
549 |
# display infos |
572 |
# display infos |
550 |
$template->param( |
573 |
$template->param( |
551 |
optionloop => \@optionloop, |
574 |
optionloop => \@optionloop, |
552 |
- |
|
|