Bugzilla – Attachment 116928 Details for
Bug 7376
Transfer limits should be checked at check-in
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7376: (follow-up) Fix C4/Circulation.pm
Bug-7376-follow-up-Fix-C4Circulationpm.patch (text/plain), 1.86 KB, created by
Arthur Suzuki
on 2021-02-17 02:41:34 UTC
(
hide
)
Description:
Bug 7376: (follow-up) Fix C4/Circulation.pm
Filename:
MIME Type:
Creator:
Arthur Suzuki
Created:
2021-02-17 02:41:34 UTC
Size:
1.86 KB
patch
obsolete
>From 130b769be33e329894d350ed06fb17cea87ba4eb Mon Sep 17 00:00:00 2001 >From: Arthur Suzuki <arthur.suzuki@biblibre.com> >Date: Wed, 17 Feb 2021 03:32:23 +0100 >Subject: [PATCH] Bug 7376: (follow-up) Fix C4/Circulation.pm > >This follow-up patch actually fixes the issue. >This patch forbids a patron to return a book to a library >from where the book may not return to its home or holding library. >--- > C4/Circulation.pm | 20 +++++++++++++++----- > 1 file changed, 15 insertions(+), 5 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 6f4a19da92..211c6101fa 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1247,15 +1247,25 @@ sub CanBookBeReturned { > $message = $to_branch = $item->homebranch; # FIXME: choice of homebranch is arbitrary > } > >+ return ($allowed, $message) unless $allowed; >+ > # Make sure there are no branch transfer limits between item's current > # branch (holdinbranch) and the return branch >- my $to_library = Koha::Libraries->find($to_branch); >- if (!$item->can_be_transferred({ to => $to_library })) { >- $allowed = 0; >- $message = $item->homebranch; >+ my $return_library = Koha::Libraries->find($to_branch); >+ if (!$item->can_be_transferred({ to => $return_library })) { >+ return (0, $item->homebranch); >+ } >+ >+ # Make sure there are no branch transfer limits between >+ # either homebranch and holdinbranch and the return branch >+ my $home_library = Koha::Libraries->find($item->homebranch); >+ my $holding_library = Koha::Libraries->find($item->holdingbranch); >+ if ($item->can_be_transferred({ from => $return_library , to => $holding_library }) or >+ $item->can_be_transferred({ from => $return_library , to => $home_library })) { >+ return (1, undef); > } > >- return ($allowed, $message); >+ return (0, $item->homebranch); > } > > =head2 CheckHighHolds >-- >2.11.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 7376
:
6954
|
21715
|
21805
|
22016
|
22017
|
22323
|
22357
|
22696
|
23168
|
76559
|
76866
|
76876
|
92740
|
92774
|
93190
|
93191
|
93192
|
93193
|
93194
|
93195
|
93196
|
107077
|
107078
|
107079
|
115369
|
115370
|
116493
|
116494
|
116927
|
116928
|
116937
|
116938
|
120897
|
120898
|
120899
|
120900
|
120901
|
120902
|
120903
|
144435
|
144436
|
144437
|
144438
|
144439
|
144440
|
144441
|
175690
|
175691
|
175692
|
175693
|
175694
|
175695
|
175696
|
175697