View | Details | Raw Unified | Return to bug 17796
Collapse All | Expand All

(-)a/Koha/OldIssue.pm (-1 / +1 lines)
Lines 1-4 Link Here
1
package Koha::OldIssue;
1
package Koha::Old::Checkout;
2
2
3
# This file is part of Koha.
3
# This file is part of Koha.
4
#
4
#
(-)a/Koha/OldIssues.pm (-3 / +3 lines)
Lines 1-4 Link Here
1
package Koha::OldIssues;
1
package Koha::Old::Checkouts;
2
2
3
# This file is part of Koha.
3
# This file is part of Koha.
4
#
4
#
Lines 18-24 package Koha::OldIssues; Link Here
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Koha::Database;
20
use Koha::Database;
21
use Koha::OldIssue;
21
use Koha::Old::Checkout;
22
22
23
use base qw(Koha::Objects);
23
use base qw(Koha::Objects);
24
24
Lines 27-33 sub _type { Link Here
27
}
27
}
28
28
29
sub object_class {
29
sub object_class {
30
    return 'Koha::OldIssue';
30
    return 'Koha::Old::Checkout';
31
}
31
}
32
32
33
1;
33
1;
(-)a/Koha/Patron.pm (-2 / +2 lines)
Lines 28-34 use Koha::Checkouts; Link Here
28
use Koha::Database;
28
use Koha::Database;
29
use Koha::DateUtils;
29
use Koha::DateUtils;
30
use Koha::Holds;
30
use Koha::Holds;
31
use Koha::OldIssues;
31
use Koha::Old::Checkouts;
32
use Koha::Patron::Categories;
32
use Koha::Patron::Categories;
33
use Koha::Patron::HouseboundProfile;
33
use Koha::Patron::HouseboundProfile;
34
use Koha::Patron::HouseboundRole;
34
use Koha::Patron::HouseboundRole;
Lines 261-267 sub do_check_for_previous_checkout { Link Here
261
    return 1 if $issues->count; # 0 || N
261
    return 1 if $issues->count; # 0 || N
262
262
263
    # Check old issues table
263
    # Check old issues table
264
    my $old_issues = Koha::OldIssues->search($criteria);
264
    my $old_issues = Koha::Old::Checkouts->search($criteria);
265
    return $old_issues->count;  # 0 || N
265
    return $old_issues->count;  # 0 || N
266
}
266
}
267
267
(-)a/Koha/REST/V1.pm (-4 / +3 lines)
Lines 23-29 use C4::Context; Link Here
23
use Koha::Account::Lines;
23
use Koha::Account::Lines;
24
use Koha::Checkouts;
24
use Koha::Checkouts;
25
use Koha::Holds;
25
use Koha::Holds;
26
use Koha::OldIssues;
26
use Koha::Old::Checkouts;
27
use Koha::Patrons;
27
use Koha::Patrons;
28
28
29
=head1 NAME
29
=head1 NAME
Lines 261-267 sub _object_ownership_by_borrowernumber { Link Here
261
261
262
First, attempts to find a Koha::Checkout-object by C<$issue_id>. If we find one,
262
First, attempts to find a Koha::Checkout-object by C<$issue_id>. If we find one,
263
compare its borrowernumber to currently logged in C<$user>. However, if an issue
263
compare its borrowernumber to currently logged in C<$user>. However, if an issue
264
is not found, attempt to find a Koha::OldIssue-object instead and compare its
264
is not found, attempt to find a Koha::Old::Checkout-object instead and compare its
265
borrowernumber to currently logged in C<$user>.
265
borrowernumber to currently logged in C<$user>.
266
266
267
=cut
267
=cut
Lines 270-276 sub _object_ownership_by_checkout_id { Link Here
270
    my ($c, $user, $issue_id) = @_;
270
    my ($c, $user, $issue_id) = @_;
271
271
272
    my $issue = Koha::Checkouts->find($issue_id);
272
    my $issue = Koha::Checkouts->find($issue_id);
273
    $issue = Koha::OldIssues->find($issue_id) unless $issue;
273
    $issue = Koha::Old::Checkouts->find($issue_id) unless $issue;
274
    return $issue && $issue->borrowernumber
274
    return $issue && $issue->borrowernumber
275
            && $user->borrowernumber == $issue->borrowernumber;
275
            && $user->borrowernumber == $issue->borrowernumber;
276
}
276
}
277
- 

Return to bug 17796