Bugzilla – Attachment 182567 Details for
Bug 35434
Non-superlibrarians should not place holds in other libraries when IndependentBranches is enabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 35434: (follow-up) Added canreservefromotherbranches
Bug-35434-follow-up-Added-canreservefromotherbranc.patch (text/plain), 1.53 KB, created by
Marcel de Rooy
on 2025-05-19 07:14:16 UTC
(
hide
)
Description:
Bug 35434: (follow-up) Added canreservefromotherbranches
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2025-05-19 07:14:16 UTC
Size:
1.53 KB
patch
obsolete
>From 76f09213fa5b383efff02d7d94b92d8fd1ea6d06 Mon Sep 17 00:00:00 2001 >From: Hammat Wele <hammat.wele@inlibro.com> >Date: Wed, 31 Jul 2024 21:28:41 +0000 >Subject: [PATCH] Bug 35434: (follow-up) Added canreservefromotherbranches >Content-Type: text/plain; charset=utf-8 > >When IndependentBranches is enabled, canreservefromotherbranches >set to don't allow is also required to prevent non-superlibrarians >from placing holds in other libraries. > >Signed-off-by: David Nind <david@davidnind.com> > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > Koha/Item.pm | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > >diff --git a/Koha/Item.pm b/Koha/Item.pm >index 7c47741c9d..c0683c2a80 100644 >--- a/Koha/Item.pm >+++ b/Koha/Item.pm >@@ -1032,7 +1032,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}; >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 35434
:
159346
|
161509
|
166648
|
169917
|
169918
|
169919
|
176045
|
176046
|
176047
|
178296
|
178297
|
178298
|
178999
|
180275
|
182566
| 182567 |
182568
|
182569