Bugzilla – Attachment 171434 Details for
Bug 33200
IndependentBranchesTransfers does not prevent holds from creating transfers
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33200: IndependentBranchesTransfers does not prevent holds from creating transfers
Bug-33200-IndependentBranchesTransfers-does-not-pr.patch (text/plain), 3.72 KB, created by
Phil Ringnalda
on 2024-09-13 01:45:37 UTC
(
hide
)
Description:
Bug 33200: IndependentBranchesTransfers does not prevent holds from creating transfers
Filename:
MIME Type:
Creator:
Phil Ringnalda
Created:
2024-09-13 01:45:37 UTC
Size:
3.72 KB
patch
obsolete
>From 2095b2f1f1d3b93e60ae18d2b1917b2da26a6666 Mon Sep 17 00:00:00 2001 >From: Hammat Wele <hammat.wele@inlibro.com> >Date: Tue, 21 Mar 2023 16:50:45 +0000 >Subject: [PATCH] Bug 33200: IndependentBranchesTransfers does not prevent > holds from creating transfers > >This patch don't concider hold made from other branches when IndependentBranchesTransfers is set to Yes and the connected user is not a SuperLibrarian > >To test, you must have > >- IndependentBranches, IndependentBranchesPatronModifications and IndependentBranchesTransfers preferences set to Yes > >- canreservefromotherbranches must be set to Don't allow > >- Circulation rules that allow holds and checkouts > >- Two libraries (I used Midway (A) and Centerville (B)) > >- A record with two items, one at each library, with barcodes, check out the one from library A > >- Two non-superlibrarian staff user, one in each library, with at least catalogue and holds permissions, this is what I gave them > > - circulate (all) > - catalogue > - delete_borrowers > - edit_borrowers > - reserveforothers (all) > >1. Log in to the staff interface with the non-superlibrarian staff user from library A > >2. Go to the record with the two items, click 'Place hold' > >3. Place a hold for a user, without changing anything (should be for 'next available item') > >4. Log out and log back in with the non-superlibrarian staff user from library B > >5. Check in the item from library B, which should be available > --> Hold is confirmed for patron from library A, transfer is created > >6. Click on 'Confirm hold and transfer' > >7. Optionally, you can log out and log back in as staff from library A > >8. Go to Circulation > Transfers to receive (should this even be available with IndependentBranchesTransfers turned on?) > --> Item from other branch is there > >9. Apply the patch > >10. Create an other record with two items, one at each library, with barcodes, check out the one from library A > >11. repeat step 1, 2, 3, 4, 5 > --> The 'Hold found' popup is not shown, because there is no hold for this item in the user branch (library B) > >12. repeat step 7,8 > --> Item from other branch is not there > >Signed-off-by: Phil Ringnalda <phil@chetcolibrary.org> >--- > C4/Reserves.pm | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index bc96dc9c3c..b5a830ca12 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -870,6 +870,8 @@ sub CheckReserves { > > # Find this item in the reserves > my @reserves = _Findgroupreserve( $item->biblionumber, $item->itemnumber, $lookahead_days, $ignore_borrowers); >+ # When IndependentBranchesTransfers is activate remove the reserve made from other branches >+ @reserves = _FilterHoldsForIndependentBranches( @reserves ); > > # $priority and $highest are used to find the most important item > # in the list returned by &_Findgroupreserve. (The lower $priority, >@@ -1778,6 +1780,30 @@ sub _Findgroupreserve { > return @results; > } > >+=head2 _Removereserve >+ >+ @reserves = &_Removereserve( @reserves ); >+ >+Check transfers is allowed from system preference and remove the reserves made from other branches >+ >+C<&_Removereserve> returns : >+C<@results> is an array of references-to-hash whose keys are mostly >+fields from the reserves table of the Koha database, plus >+ >+=cut >+ >+sub _Removereserve { >+ my ( @reserves) = @_; >+ if ( C4::Context->preference("IndependentBranchesTransfers") && !C4::Context->IsSuperLibrarian() && scalar @reserves) { >+ my @results; >+ foreach my $res (@reserves) { >+ push( @results, $res ) if ($res->{branchcode} eq C4::Context->userenv->{'branch'}); >+ } >+ return @results; >+ } >+ return @reserves; >+} >+ > =head2 _koha_notify_reserve > > _koha_notify_reserve( $hold->reserve_id ); >-- >2.44.0
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 33200
:
148212
|
148484
|
148918
|
151129
|
151130
|
151348
|
151349
|
154552
|
155482
|
155483
|
155484
|
158188
|
158189
|
158190
|
171434
|
171435
|
171436
|
172707
|
172708
|
172709