From 8db58fee70b02b893d11b8775795673ccd708e1f Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Sat, 23 Aug 2014 14:26:31 -0400 Subject: [PATCH] Fix a few issues with retrieving block or trap for LookupUser. We also now say holds are blocked if holds fulfillment is blocked for the patron. Signed-off-by: Jason Stephenson --- lib/NCIP/ILS/Evergreen.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/NCIP/ILS/Evergreen.pm b/lib/NCIP/ILS/Evergreen.pm index 61c7c0f..158ec5f 100644 --- a/lib/NCIP/ILS/Evergreen.pm +++ b/lib/NCIP/ILS/Evergreen.pm @@ -251,7 +251,7 @@ sub lookupuser { my $blocks = []; # First, let's check if the profile is blocked from ILL. - if (grep {$_->id() == $user->profile()} @{$self->{block_profiles}}) { + if (grep {$_->id() == $user->profile()} @{$self->{blocked_profiles}}) { my $block = NCIP::User::BlockOrTrap->new(); $block->AgencyId($aou->shortname()); $block->BlockOrTrapType('Block Interlibrary Loan'); @@ -262,8 +262,9 @@ sub lookupuser { # looking for blocks on CIRC, HOLD, and RENEW. my ($have_circ, $have_renew, $have_hold) = (0,0,0); foreach my $penalty (@{$user->standing_penalties()}) { + next unless($penalty->standing_penalty->block_list()); my @block_list = split(/\|/, $penalty->standing_penalty->block_list()); - my $ou = $self->editor->retrieve_actor_org_unit($penalty->standing_penalty->org_unit()); + my $ou = $self->editor->retrieve_actor_org_unit($penalty->org_unit()); # Block checkout. if (!$have_circ && grep {$_ eq 'CIRC'} @block_list) { @@ -275,9 +276,9 @@ sub lookupuser { } # Block holds. - if (!$have_hold && grep {$_ eq 'HOLD'} @block_list) { + if (!$have_hold && grep {$_ eq 'HOLD' || $_ eq 'FULFILL'} @block_list) { my $bot = NCIP::User::BlockOrTrap->new(); - $bot->AgencyId($ou->shotrname()); + $bot->AgencyId($ou->shortname()); $bot->BlockOrTrapType('Block Holds'); push @$blocks, $bot; $have_hold = 1; -- 2.43.2