Bugzilla – Attachment 57504 Details for
Bug 17599
Move C4::Circulation::GetIssuingRule to Koha::IssuingRules->get_effective_issuing_rule
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17599: (QA followup) Perltidy really long lines
Bug-17599-QA-followup-Perltidy-really-long-lines.patch (text/plain), 6.00 KB, created by
Tomás Cohen Arazi (tcohen)
on 2016-11-15 15:35:49 UTC
(
hide
)
Description:
Bug 17599: (QA followup) Perltidy really long lines
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2016-11-15 15:35:49 UTC
Size:
6.00 KB
patch
obsolete
>From e08b04f187104ded25c06f02631b1933eeecede5 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Tue, 15 Nov 2016 12:32:53 -0300 >Subject: [PATCH] Bug 17599: (QA followup) Perltidy really long lines > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > C4/Circulation.pm | 59 +++++++++++++++++++++++++++++++++++++++++++++++-------- > 1 file changed, 51 insertions(+), 8 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index b622538..9e085ef 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -397,7 +397,13 @@ sub TooMany { > > # given branch, patron category, and item type, determine > # applicable issuing rule >- my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $cat_borrower, itemtype => $type, branchcode => $branch }); >+ my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( >+ { categorycode => $cat_borrower, >+ itemtype => $type, >+ branchcode => $branch >+ } >+ ); >+ > > # if a rule is found and has a loan limit set, count > # how many loans the patron already has that meet that >@@ -1333,7 +1339,13 @@ sub AddIssue { > > # If automatic renewal wasn't selected while issuing, set the value according to the issuing rule. > unless ($auto_renew) { >- my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $borrower->{categorycode}, itemtype => $item->{itype}, branchcode => $branch }); >+ my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( >+ { categorycode => $borrower->{categorycode}, >+ itemtype => $item->{itype}, >+ branchcode => $branch >+ } >+ ); >+ > $auto_renew = $issuing_rule->auto_renew if $issuing_rule; > } > >@@ -1533,7 +1545,13 @@ Get the Hard Due Date and it's comparison for an itemtype, a borrower type and a > sub GetHardDueDate { > my ( $borrowertype, $itemtype, $branchcode ) = @_; > >- my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $borrowertype, itemtype => $itemtype, branchcode => $branchcode }); >+ my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( >+ { categorycode => $borrowertype, >+ itemtype => $itemtype, >+ branchcode => $branchcode >+ } >+ ); >+ > > if ( defined( $issuing_rule ) ) { > if ( $issuing_rule->hardduedate ) { >@@ -2185,7 +2203,12 @@ sub _debar_user_on_return { > my $branchcode = _GetCircControlBranch( $item, $borrower ); > > my $circcontrol = C4::Context->preference('CircControl'); >- my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $borrower->{categorycode}, itemtype => $item->{itype}, branchcode => $branchcode }); >+ my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( >+ { categorycode => $borrower->{categorycode}, >+ itemtype => $item->{itype}, >+ branchcode => $branchcode >+ } >+ ); > my $finedays = $issuing_rule ? $issuing_rule->finedays : undef; > my $unit = $issuing_rule ? $issuing_rule->lengthunit : undef; > my $chargeable_units = C4::Overdues::get_chargeable_units($unit, $dt_due, $dt_today, $branchcode); >@@ -2780,7 +2803,12 @@ sub CanBookBeRenewed { > return ( 1, undef ) if $override_limit; > > my $branchcode = _GetCircControlBranch( $item, $borrower ); >- my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $borrower->{categorycode}, itemtype => $item->{itype}, branchcode => $branchcode }); >+ my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( >+ { categorycode => $borrower->{categorycode}, >+ itemtype => $item->{itype}, >+ branchcode => $branchcode >+ } >+ ); > > return ( 0, "too_many" ) > if not $issuing_rule or $issuing_rule->renewalsallowed <= $itemissue->{renewals}; >@@ -3022,7 +3050,12 @@ sub GetRenewCount { > # $item and $borrower should be calculated > my $branchcode = _GetCircControlBranch($item, $borrower); > >- my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $borrower->{categorycode}, itemtype => $item->{itype}, branchcode => $branchcode }); >+ my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( >+ { categorycode => $borrower->{categorycode}, >+ itemtype => $item->{itype}, >+ branchcode => $branchcode >+ } >+ ); > > $renewsallowed = $issuing_rule ? $issuing_rule->renewalsallowed : undef; # FIXME Just replace undef with 0 to get what we expected. But what about the side-effects? TODO LATER > $renewsleft = $renewsallowed - $renewcount; >@@ -3062,7 +3095,12 @@ sub GetSoonestRenewDate { > or return; > > my $branchcode = _GetCircControlBranch( $item, $borrower ); >- my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $borrower->{categorycode}, itemtype => $item->{itype}, branchcode => $branchcode }); >+ my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( >+ { categorycode => $borrower->{categorycode}, >+ itemtype => $item->{itype}, >+ branchcode => $branchcode >+ } >+ ); > > my $now = dt_from_string; > return $now unless $issuing_rule; >@@ -3117,7 +3155,12 @@ sub GetLatestAutoRenewDate { > or return; > > my $branchcode = _GetCircControlBranch( $item, $borrower ); >- my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule({ categorycode => $borrower->{categorycode}, itemtype => $item->{itype}, branchcode => $branchcode }); >+ my $issuing_rule = Koha::IssuingRules->get_effective_issuing_rule( >+ { categorycode => $borrower->{categorycode}, >+ itemtype => $item->{itype}, >+ branchcode => $branchcode >+ } >+ ); > > return unless $issuing_rule; > return if not $issuing_rule->no_auto_renewal_after >-- >2.7.4
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 17599
:
57393
|
57494
|
57501
|
57502
|
57503
| 57504 |
57506