From: Bill Erickson Date: Thu, 7 Jul 2011 18:08:28 +0000 (-0400) Subject: Ignore part-mapped copies for mr/title/volume holds X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e11ca376239610ced428750584f1f0196dc8bcd0;p=evergreen%2Fequinox.git Ignore part-mapped copies for mr/title/volume holds Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm index 651e9b52ad..671819a3df 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Holds.pm @@ -2284,11 +2284,13 @@ sub _check_title_hold_is_possible { } }, acpl => { field => 'id', filter => { holdable => 't'}, fkey => 'location' }, - ccs => { field => 'id', filter => { holdable => 't'}, fkey => 'status' } + ccs => { field => 'id', filter => { holdable => 't'}, fkey => 'status' }, + acpm => { field => 'target_copy', type => 'left' } # ignore part-linked copies } }, where => { - '+acp' => { circulate => 't', deleted => 'f', holdable => 't', %org_filter } + '+acp' => { circulate => 't', deleted => 'f', holdable => 't', %org_filter }, + '+acpm' => { target_copy => undef } # ignore part-linked copies } } ); @@ -2657,6 +2659,14 @@ sub _check_volume_hold_is_possible { my $copies = new_editor->search_asset_copy({call_number => $vol->id, %org_filter}); $logger->info("checking possibility of volume hold for volume ".$vol->id); + my $filter_copies = []; + for my $copy (@$copies) { + # ignore part-mapped copies for regular volume level holds + push(@$filter_copies, $copy) unless + new_editor->search_asset_copy_part_map({target_copy => $copy->id})->[0]; + } + $copies = $filter_copies; + return ( 0, 0, [ new OpenILS::Event(