[open-ils-commits] [GIT] Evergreen ILS branch master updated. 8f2a17b6fa2978a867ba7178b0fbc196a968fd7b

Evergreen Git git at git.evergreen-ils.org
Mon Nov 14 11:08:59 EST 2011


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  8f2a17b6fa2978a867ba7178b0fbc196a968fd7b (commit)
      from  13bad8097a693995089e08c9bc4352445dec1929 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8f2a17b6fa2978a867ba7178b0fbc196a968fd7b
Author: Thomas Berezansky <tsbere at mvlc.org>
Date:   Wed Oct 26 09:45:54 2011 -0400

    Make checkin retargeting parts-aware
    
    Skip part holds on copies san parts
    Skip part holds for parts not on the copy
    Skip title holds for copies with parts
    
    Signed-off-by: Thomas Berezansky <tsbere at mvlc.org>
    Signed-off-by: Bill Erickson <berick at esilibrary.com>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
index 92cc110..720bc68 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Circulate.pm
@@ -2343,6 +2343,11 @@ sub checkin_retarget {
 
     return if scalar(@$holds) == 0; # No holds, no retargeting
 
+    # Check for parts on this copy
+    my $parts = $self->editor->search_asset_copy_part_map({ target_copy => $self->copy->id });
+    my %parts_hash = ();
+    %parts_hash = map {$_->id, 1} @$parts if @$parts;
+
     # Loop over holds in request-ish order
     # Stage 1: Get them into request-ish order
     # Also grab type and target for skipping low hanging ones
@@ -2366,6 +2371,15 @@ sub checkin_retarget {
                 and $_->{target} != $self->copy->id);
             # Volume level, but not this volume?
             next if ($_->{hold_type} eq 'V' and $_->{target} != $self->volume->id);
+            if(@$parts) { # We have parts?
+                # Skip title holds
+                next if ($_->{hold_type} eq 'T');
+                # Skip part holds for parts not on this copy
+                next if ($_->{hold_type} eq 'P' and not $parts_hash{$_->{target}});
+            } else {
+                # No parts, no part holds
+                next if ($_->{hold_type} eq 'P');
+            }
             # So much for easy stuff, attempt a retarget!
             my $tresult = $U->storagereq('open-ils.storage.action.hold_request.copy_targeter', undef, $_->{id}, $self->copy->id);
             if(ref $tresult eq "ARRAY" and scalar @$tresult) {

-----------------------------------------------------------------------

Summary of changes:
 .../lib/OpenILS/Application/Circ/Circulate.pm      |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list