Bugzilla – Attachment 148484 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.63 KB, created by
Hammat wele
on 2023-03-21 16:55:58 UTC
(
hide
)
Description:
Bug 33200: IndependentBranchesTransfers does not prevent holds from creating transfers
Filename:
MIME Type:
Creator:
Hammat wele
Created:
2023-03-21 16:55:58 UTC
Size:
3.63 KB
patch
obsolete
>From 9f820ab5d5edaa03b2e0144089a2b97f5a069268 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 >--- > C4/Reserves.pm | 26 ++++++++++++++++++++++++++ > 1 file changed, 26 insertions(+) > >diff --git a/C4/Reserves.pm b/C4/Reserves.pm >index 987543e1cd..e52ef0ab37 100644 >--- a/C4/Reserves.pm >+++ b/C4/Reserves.pm >@@ -909,6 +909,8 @@ sub CheckReserves { > > # Find this item in the reserves > my @reserves = _Findgroupreserve( $bibitem, $biblio, $itemnumber, $lookahead_days, $ignore_borrowers); >+ # When IndependentBranchesTransfers is activate remove the reserve made from other branches >+ @reserves = _Removereserve( @reserves ); > > # $priority and $highest are used to find the most important item > # in the list returned by &_Findgroupreserve. (The lower $priority, >@@ -1843,6 +1845,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.34.1
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