Bugzilla – Attachment 73189 Details for
Bug 19943
Koha::Biblio - Remove GetBiblioItemData
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 19943: Remove itemtype vs itype confusion in CanBookBeIssued
Bug-19943-Remove-itemtype-vs-itype-confusion-in-Ca.patch (text/plain), 3.55 KB, created by
Jonathan Druart
on 2018-03-23 15:32:45 UTC
(
hide
)
Description:
Bug 19943: Remove itemtype vs itype confusion in CanBookBeIssued
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2018-03-23 15:32:45 UTC
Size:
3.55 KB
patch
obsolete
>From 3953fdb921d7f280ffbaca813956357aa67d42ca Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 9 Jan 2018 14:29:50 -0300 >Subject: [PATCH] Bug 19943: Remove itemtype vs itype confusion in > CanBookBeIssued > >Just a preliminary step to clean the code a bit in CanBookBeIssued. >The effective item type is already set from GetItem and we do not need >to deal with that again. > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > C4/Circulation.pm | 15 +++++++-------- > 1 file changed, 7 insertions(+), 8 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index d150ce1e30..f2e4f90108 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -670,7 +670,7 @@ sub CanBookBeIssued { > my $item = GetItem(undef, $barcode ); > my $issue = Koha::Checkouts->find( { itemnumber => $item->{itemnumber} } ); > my $biblioitem = GetBiblioItemData($item->{biblioitemnumber}); >- $item->{'itemtype'}=$item->{'itype'}; >+ my $effective_itemtype = $item->{itype}; # GetItem deals with that > my $dbh = C4::Context->dbh; > my $patron_unblessed = $patron->unblessed; > >@@ -691,8 +691,7 @@ sub CanBookBeIssued { > my $issuedate = $now->clone(); > > my $branch = _GetCircControlBranch($item, $patron_unblessed); >- my $itype = ( C4::Context->preference('item-level_itypes') ) ? $item->{'itype'} : $biblioitem->{'itemtype'}; >- $duedate = CalcDateDue( $issuedate, $itype, $branch, $patron_unblessed ); >+ $duedate = CalcDateDue( $issuedate, $effective_itemtype, $branch, $patron_unblessed ); > > # Offline circ calls AddIssue directly, doesn't run through here > # So issuingimpossible should be ok. >@@ -716,7 +715,7 @@ sub CanBookBeIssued { > branch => C4::Context->userenv->{'branch'}, > type => 'localuse', > itemnumber => $item->{'itemnumber'}, >- itemtype => $item->{'itype'}, >+ itemtype => $effective_itemtype, > borrowernumber => $patron->borrowernumber, > ccode => $item->{'ccode'}} > ); >@@ -921,20 +920,20 @@ sub CanBookBeIssued { > if ($notforloan->{'notforloan'}) { > if (!C4::Context->preference("AllowNotForLoanOverride")) { > $issuingimpossible{NOT_FOR_LOAN} = 1; >- $issuingimpossible{itemtype_notforloan} = $item->{'itype'}; >+ $issuingimpossible{itemtype_notforloan} = $effective_itemtype; > } else { > $needsconfirmation{NOT_FOR_LOAN_FORCING} = 1; >- $needsconfirmation{itemtype_notforloan} = $item->{'itype'}; >+ $needsconfirmation{itemtype_notforloan} = $effective_itemtype; > } > } > } > elsif ($biblioitem->{'notforloan'} == 1){ > if (!C4::Context->preference("AllowNotForLoanOverride")) { > $issuingimpossible{NOT_FOR_LOAN} = 1; >- $issuingimpossible{itemtype_notforloan} = $biblioitem->{'itemtype'}; >+ $issuingimpossible{itemtype_notforloan} = $effective_itemtype; > } else { > $needsconfirmation{NOT_FOR_LOAN_FORCING} = 1; >- $needsconfirmation{itemtype_notforloan} = $biblioitem->{'itemtype'}; >+ $needsconfirmation{itemtype_notforloan} = $effective_itemtype; > } > } > } >-- >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 19943
:
70384
|
70385
|
70386
|
72568
|
72569
|
72570
|
72593
|
72594
|
72595
|
72596
| 73189 |
73190
|
73191
|
73192
|
73194
|
73198
|
73199
|
73200