In a consortial setting, SHAREit can be told the makeup of your
local "network" of systems, and if an item can be found in-network,
a local hold can be placed instead of an ILL request. Without this
change, the item must be held by the user's home library specifically.
Signed-off-by: Jason Boyer <jboyer@library.in.gov>
} elsif (ref($item) eq 'Fieldmapper::biblio::record_entry') {
$params->{hold_type} = 'T';
if ($org_unit && ref($org_unit) eq 'Fieldmapper::actor::org_unit') {
- $params->{selection_ou} = $org_unit->id();
- $params->{depth} = $org_unit->ou_type->depth() if (ref($org_unit->ou_type()));
+ # If the user home ou is in the same system as our service account assume it's an institutional account and
+ # limit the selection ou and depth, otherwise assume a "regular" hold.
+ if ( $U->org_unit_ancestor_at_depth($user->home_ou->id(), 1) == $U->org_unit_ancestor_at_depth($self->{session}->{work_ou}->id(), 1) ) {
+ $params->{selection_ou} = $org_unit->id();
+ $params->{depth} = $org_unit->ou_type->depth() if (ref($org_unit->ou_type()));
+ }
}
}