From a8b5344fb0667f75d95efa2a8e5ce7e0a454ed03 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 20 Dec 2016 14:28:00 +0100 Subject: [PATCH] Bug 17796: Move Koha::OldIssue[s] to Koha::Checkout[s] --- Koha/{OldIssue.pm => Old/Checkout.pm} | 2 +- Koha/{OldIssues.pm => Old/Checkouts.pm} | 6 +++--- Koha/Patron.pm | 4 ++-- Koha/REST/V1.pm | 6 +++--- 4 files changed, 9 insertions(+), 9 deletions(-) rename Koha/{OldIssue.pm => Old/Checkout.pm} (96%) rename Koha/{OldIssues.pm => Old/Checkouts.pm} (90%) diff --git a/Koha/OldIssue.pm b/Koha/Old/Checkout.pm similarity index 96% rename from Koha/OldIssue.pm rename to Koha/Old/Checkout.pm index 5b3784d..3a7c1eb 100644 --- a/Koha/OldIssue.pm +++ b/Koha/Old/Checkout.pm @@ -1,4 +1,4 @@ -package Koha::OldIssue; +package Koha::Old::Checkout; # This file is part of Koha. # diff --git a/Koha/OldIssues.pm b/Koha/Old/Checkouts.pm similarity index 90% rename from Koha/OldIssues.pm rename to Koha/Old/Checkouts.pm index 56edfb1..c7f1a6a 100644 --- a/Koha/OldIssues.pm +++ b/Koha/Old/Checkouts.pm @@ -1,4 +1,4 @@ -package Koha::OldIssues; +package Koha::Old::Checkouts; # This file is part of Koha. # @@ -18,7 +18,7 @@ package Koha::OldIssues; use Modern::Perl; use Koha::Database; -use Koha::OldIssue; +use Koha::Old::Checkout; use base qw(Koha::Objects); @@ -27,7 +27,7 @@ sub _type { } sub object_class { - return 'Koha::OldIssue'; + return 'Koha::Old::Checkout'; } 1; diff --git a/Koha/Patron.pm b/Koha/Patron.pm index fe2d844..9c6e051 100644 --- a/Koha/Patron.pm +++ b/Koha/Patron.pm @@ -28,7 +28,7 @@ use Koha::Checkouts; use Koha::Database; use Koha::DateUtils; use Koha::Holds; -use Koha::OldIssues; +use Koha::Old::Checkouts; use Koha::Patron::Categories; use Koha::Patron::HouseboundProfile; use Koha::Patron::HouseboundRole; @@ -261,7 +261,7 @@ sub do_check_for_previous_checkout { return 1 if $issues->count; # 0 || N # Check old issues table - my $old_issues = Koha::OldIssues->search($criteria); + my $old_issues = Koha::Old::Checkouts->search($criteria); return $old_issues->count; # 0 || N } diff --git a/Koha/REST/V1.pm b/Koha/REST/V1.pm index 5e1eded..e307552 100644 --- a/Koha/REST/V1.pm +++ b/Koha/REST/V1.pm @@ -23,7 +23,7 @@ use C4::Context; use Koha::Account::Lines; use Koha::Checkouts; use Koha::Holds; -use Koha::OldIssues; +use Koha::Old::Checkouts; use Koha::Patrons; =head1 NAME @@ -261,7 +261,7 @@ sub _object_ownership_by_borrowernumber { First, attempts to find a Koha::Checkout-object by C<$issue_id>. If we find one, compare its borrowernumber to currently logged in C<$user>. However, if an issue -is not found, attempt to find a Koha::OldIssue-object instead and compare its +is not found, attempt to find a Koha::Old::Checkout-object instead and compare its borrowernumber to currently logged in C<$user>. =cut @@ -270,7 +270,7 @@ sub _object_ownership_by_checkout_id { my ($c, $user, $issue_id) = @_; my $issue = Koha::Checkouts->find($issue_id); - $issue = Koha::OldIssues->find($issue_id) unless $issue; + $issue = Koha::Old::Checkouts->find($issue_id) unless $issue; return $issue && $issue->borrowernumber && $user->borrowernumber == $issue->borrowernumber; } -- 2.9.3