Bugzilla – Attachment 93194 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]
(ANOTHER IMPLEMENTATION) Bug 7376: Refactoring subroutines
Bug-7376-Refactoring-subroutines.patch (text/plain), 3.56 KB, created by
Lari Taskula
on 2019-09-27 11:51:57 UTC
(
hide
)
Description:
(ANOTHER IMPLEMENTATION) Bug 7376: Refactoring subroutines
Filename:
MIME Type:
Creator:
Lari Taskula
Created:
2019-09-27 11:51:57 UTC
Size:
3.56 KB
patch
obsolete
>From ab770ba680c502c327df8226afb85f3d4475e200 Mon Sep 17 00:00:00 2001 >From: Lari Taskula <lari.taskula@hypernova.fi> >Date: Fri, 30 Aug 2019 16:30:07 +0000 >Subject: [PATCH] Bug 7376: Refactoring subroutines > >CanBookBeReturned: >- Take Koha::Item as parameter instead of HASHref of an item > >To test: >1. cd into your Koha root directory >2. grep -rn 'CanBookBeReturned(' >3. Make sure all returned occurences are using Koha::Item > >Sponsored-by: National Library of Finland >--- > C4/Circulation.pm | 20 ++++++++++---------- > 1 file changed, 10 insertions(+), 10 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 66993ea461..dd24308894 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -877,7 +877,7 @@ sub CanBookBeIssued { > > my $patron = Koha::Patrons->find( $issue->borrowernumber ); > >- my ( $can_be_returned, $message ) = CanBookBeReturned( $item_unblessed, C4::Context->userenv->{branch} ); >+ my ( $can_be_returned, $message ) = CanBookBeReturned( $item_object, C4::Context->userenv->{branch} ); > > unless ( $can_be_returned ) { > $issuingimpossible{RETURN_IMPOSSIBLE} = 1; >@@ -1120,7 +1120,7 @@ Check whether the item can be returned to the provided branch > > =over 4 > >-=item C<$item> is a hash of item information as returned Koha::Items->find->unblessed (Temporary, should be a Koha::Item instead) >+=item C<$item> is a Koha::Item object > > =item C<$branch> is the branchcode where the return is taking place > >@@ -1147,15 +1147,15 @@ sub CanBookBeReturned { > my $message; > > # identify all cases where return is forbidden >- if ($allowreturntobranch eq 'homebranch' && $branch ne $item->{'homebranch'}) { >+ if ($allowreturntobranch eq 'homebranch' && $branch ne $item->homebranch) { > $allowed = 0; >- $message = $item->{'homebranch'}; >- } elsif ($allowreturntobranch eq 'holdingbranch' && $branch ne $item->{'holdingbranch'}) { >+ $message = $item->homebranch; >+ } elsif ($allowreturntobranch eq 'holdingbranch' && $branch ne $item->holdingbranch) { > $allowed = 0; >- $message = $item->{'holdingbranch'}; >- } elsif ($allowreturntobranch eq 'homeorholdingbranch' && $branch ne $item->{'homebranch'} && $branch ne $item->{'holdingbranch'}) { >+ $message = $item->holdingbranch; >+ } elsif ($allowreturntobranch eq 'homeorholdingbranch' && $branch ne $item->homebranch && $branch ne $item->holdingbranch) { > $allowed = 0; >- $message = $item->{'homebranch'}; # FIXME: choice of homebranch is arbitrary >+ $message = $item->homebranch; # FIXME: choice of homebranch is arbitrary > } > > return ($allowed, $message); >@@ -1361,7 +1361,7 @@ sub AddIssue { > if ( $actualissue and not $switch_onsite_checkout ) { > # This book is currently on loan, but not to the person > # who wants to borrow it now. mark it returned before issuing to the new borrower >- my ( $allowed, $message ) = CanBookBeReturned( $item_unblessed, C4::Context->userenv->{branch} ); >+ my ( $allowed, $message ) = CanBookBeReturned( $item_object, C4::Context->userenv->{branch} ); > return unless $allowed; > AddReturn( $item_object->barcode, C4::Context->userenv->{'branch'} ); > } >@@ -1924,7 +1924,7 @@ sub AddReturn { > } > > # check if the return is allowed at this branch >- my ($returnallowed, $message) = CanBookBeReturned($item_unblessed, $branch); >+ my ($returnallowed, $message) = CanBookBeReturned($item, $branch); > unless ($returnallowed){ > $messages->{'Wrongbranch'} = { > Wrongbranch => $branch, >-- >2.17.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 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