Bugzilla – Attachment 159729 Details for
Bug 18139
'Too many checked out' can confuse librarians
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18139: Tidy code
Bug-18139-Tidy-code.patch (text/plain), 5.57 KB, created by
Kyle M Hall
on 2023-12-12 12:04:54 UTC
(
hide
)
Description:
Bug 18139: Tidy code
Filename:
MIME Type:
Creator:
Kyle M Hall
Created:
2023-12-12 12:04:54 UTC
Size:
5.57 KB
patch
obsolete
>From 29dab76c58f8a7194c9137feacdaa85cb169b63c Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 12 Dec 2023 06:57:42 -0500 >Subject: [PATCH] Bug 18139: Tidy code > >--- > C4/Circulation.pm | 18 +++++++++--------- > t/db_dependent/Circulation/TooMany.t | 22 +++++++++++----------- > 2 files changed, 20 insertions(+), 20 deletions(-) > >diff --git a/C4/Circulation.pm b/C4/Circulation.pm >index 13ca90e9f24..562cad72671 100644 >--- a/C4/Circulation.pm >+++ b/C4/Circulation.pm >@@ -1027,19 +1027,19 @@ sub CanBookBeIssued { > # if TooMany max_allowed returns 0 the user doesn't have permission to check out this book > if ( $toomany && not exists $needsconfirmation{RENEW_ISSUE} ) { > if ( $toomany->{max_allowed} == 0 ) { >- $needsconfirmation{PATRON_CANT} = 1; >+ $needsconfirmation{PATRON_CANT} = 1; > $needsconfirmation{circulation_rule_PATRON_CANT} = $toomany->{circulation_rule}; > } > if ( C4::Context->preference("AllowTooManyOverride") ) { >- $needsconfirmation{TOO_MANY} = $toomany->{reason}; >- $needsconfirmation{current_loan_count} = $toomany->{count}; >- $needsconfirmation{max_loans_allowed} = $toomany->{max_allowed}; >- $needsconfirmation{circulation_rule_TOO_MANY} = $toomany->{circulation_rule}; >+ $needsconfirmation{TOO_MANY} = $toomany->{reason}; >+ $needsconfirmation{current_loan_count} = $toomany->{count}; >+ $needsconfirmation{max_loans_allowed} = $toomany->{max_allowed}; >+ $needsconfirmation{circulation_rule_TOO_MANY} = $toomany->{circulation_rule}; > } else { >- $issuingimpossible{TOO_MANY} = $toomany->{reason}; >- $issuingimpossible{current_loan_count} = $toomany->{count}; >- $issuingimpossible{max_loans_allowed} = $toomany->{max_allowed}; >- $needsconfirmation{circulation_rule_TOO_MANY} = $toomany->{circulation_rule}; >+ $issuingimpossible{TOO_MANY} = $toomany->{reason}; >+ $issuingimpossible{current_loan_count} = $toomany->{count}; >+ $issuingimpossible{max_loans_allowed} = $toomany->{max_allowed}; >+ $needsconfirmation{circulation_rule_TOO_MANY} = $toomany->{circulation_rule}; > } > } > >diff --git a/t/db_dependent/Circulation/TooMany.t b/t/db_dependent/Circulation/TooMany.t >index 44b0a9bffa8..02e972a353e 100755 >--- a/t/db_dependent/Circulation/TooMany.t >+++ b/t/db_dependent/Circulation/TooMany.t >@@ -209,8 +209,8 @@ subtest '1 Issuingrule exist with onsiteissueqty=unlimited' => sub { > is_deeply( > $data, > { >- reason => 'TOO_MANY_CHECKOUTS', >- count => 1, >+ reason => 'TOO_MANY_CHECKOUTS', >+ count => 1, > max_allowed => 1, > }, > 'CO should not be allowed if ConsiderOnSiteCheckoutsAsNormalCheckouts == 1' >@@ -289,15 +289,15 @@ subtest '1 Issuingrule exist: 1 CO allowed, 1 OSCO allowed. Do a CO' => sub { > my $issue = C4::Circulation::AddIssue( $patron, $item->barcode, dt_from_string() ); > like( $issue->issue_id, qr|^\d+$|, 'The issue should have been inserted' ); > >- t::lib::Mocks::mock_preference('ConsiderOnSiteCheckoutsAsNormalCheckouts', 0); >+ t::lib::Mocks::mock_preference( 'ConsiderOnSiteCheckoutsAsNormalCheckouts', 0 ); > my $data = C4::Circulation::TooMany( $patron, $item ); > my $rule = delete $data->{circulation_rule}; > is( ref $rule, 'Koha::CirculationRule', 'Circulation rule was returned' ); > is_deeply( > $data, > { >- reason => 'TOO_MANY_CHECKOUTS', >- count => 1, >+ reason => 'TOO_MANY_CHECKOUTS', >+ count => 1, > max_allowed => 1, > }, > 'CO should not be allowed if ConsiderOnSiteCheckoutsAsNormalCheckouts == 0' >@@ -357,7 +357,7 @@ subtest '1 Issuingrule exist: 1 CO allowed, 1 OSCO allowed, Do a OSCO' => sub { > my $issue = C4::Circulation::AddIssue( $patron, $item->barcode, dt_from_string(), undef, undef, undef, { onsite_checkout => 1 } ); > like( $issue->issue_id, qr|^\d+$|, 'The issue should have been inserted' ); > >- t::lib::Mocks::mock_preference('ConsiderOnSiteCheckoutsAsNormalCheckouts', 0); >+ t::lib::Mocks::mock_preference( 'ConsiderOnSiteCheckoutsAsNormalCheckouts', 0 ); > is( > C4::Circulation::TooMany( $patron, $item ), > undef, >@@ -369,22 +369,22 @@ subtest '1 Issuingrule exist: 1 CO allowed, 1 OSCO allowed, Do a OSCO' => sub { > is_deeply( > $data, > { >- reason => 'TOO_MANY_ONSITE_CHECKOUTS', >- count => 1, >+ reason => 'TOO_MANY_ONSITE_CHECKOUTS', >+ count => 1, > max_allowed => 1, > }, > 'OSCO should not be allowed if ConsiderOnSiteCheckoutsAsNormalCheckouts == 0' > ); > >- t::lib::Mocks::mock_preference('ConsiderOnSiteCheckoutsAsNormalCheckouts', 1); >+ t::lib::Mocks::mock_preference( 'ConsiderOnSiteCheckoutsAsNormalCheckouts', 1 ); > $data = C4::Circulation::TooMany( $patron, $item ); > $rule = delete $data->{circulation_rule}; > is( ref $rule, 'Koha::CirculationRule', 'Circulation rule was returned' ); > is_deeply( > $data, > { >- reason => 'TOO_MANY_CHECKOUTS', >- count => 1, >+ reason => 'TOO_MANY_CHECKOUTS', >+ count => 1, > max_allowed => 1, > }, > 'CO should not be allowed if ConsiderOnSiteCheckoutsAsNormalCheckouts == 1' >-- >2.30.2
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 18139
:
60427
|
60428
|
60429
|
61489
|
61490
|
61491
|
61541
|
61542
|
61543
|
61663
|
159307
|
159308
|
159522
|
159523
|
159728
|
159729
|
159740
|
159904
|
159905
|
159906
|
159907