@@ -, +, @@ addition to canreservefromotherbranches to prevent non-superlibrarians from placing holds in other libraries --- Koha/Item.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) --- a/Koha/Item.pm +++ a/Koha/Item.pm @@ -990,9 +990,15 @@ is not passed. sub pickup_locations { my ($self, $params) = @_; - - return Koha::Libraries->search( { branchcode => $self->holdingbranch } ) if C4::Context->preference("IndependentBranches") && !C4::Context->IsSuperLibrarian(); - + if ( C4::Context->preference("IndependentBranches") + and !C4::Context->preference("canreservefromotherbranches") ) + { + my $userenv = C4::Context->userenv; + unless ( C4::Context->IsSuperLibrarian ) { + return Koha::Libraries->new()->empty if ( $self->homebranch ne $userenv->{branch} ); + return Koha::Libraries->search( { branchcode => $self->homebranch } ); + } + } Koha::Exceptions::MissingParameter->throw( parameter => 'patron' ) unless exists $params->{patron}; --