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

(-)a/Koha/Item.pm (-1 / +18 lines)
Lines 332-337 sub safe_delete { Link Here
332
332
333
    $self->move_to_deleted;
333
    $self->move_to_deleted;
334
334
335
    $self->old_checkouts->update( { deleted_itemnumber => $self->itemnumber } );
336
335
    return $self->delete($params);
337
    return $self->delete($params);
336
}
338
}
337
339
Lines 500-510 Return the checkout for this item Link Here
500
502
501
sub checkout {
503
sub checkout {
502
    my ($self) = @_;
504
    my ($self) = @_;
503
    my $checkout_rs = $self->_result->issue;
505
    my $checkout_rs = $self->_result->checkout;
504
    return unless $checkout_rs;
506
    return unless $checkout_rs;
505
    return Koha::Checkout->_new_from_dbic($checkout_rs);
507
    return Koha::Checkout->_new_from_dbic($checkout_rs);
506
}
508
}
507
509
510
=head3 old_checkouts
511
512
my $old_checkouts = $item->old_checkouts;
513
514
Return the old checkouts for this item
515
516
=cut
517
518
sub old_checkouts {
519
    my ($self) = @_;
520
    my $rs = $self->_result->old_checkouts;
521
    require Koha::Old::Checkouts;
522
    return Koha::Old::Checkouts->_new_from_dbic($rs);
523
}
524
508
=head3 serial_item
525
=head3 serial_item
509
526
510
=cut
527
=cut
(-)a/Koha/Old/Checkout.pm (+16 lines)
Lines 47-52 sub item { Link Here
47
    return Koha::Item->_new_from_dbic($item_rs);
47
    return Koha::Item->_new_from_dbic($item_rs);
48
}
48
}
49
49
50
=head3 deleted_item
51
52
my $deleted_item = $checkout->deleted_item;
53
54
Return the checked out item that has been deleted
55
56
=cut
57
58
sub deleted_item {
59
    my ($self) = @_;
60
    my $rs = $self->_result->deleted_item;
61
    return unless $rs;
62
    require Koha::Old::Item;
63
    return Koha::Old::Item->_new_from_dbic($rs);
64
}
65
50
=head3 account_lines
66
=head3 account_lines
51
67
52
my $account_lines = $checkout->account_lines;
68
my $account_lines = $checkout->account_lines;
(-)a/Koha/Old/Item.pm (-1 / +15 lines)
Lines 17-23 package Koha::Old::Item; Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use base qw(Koha::Object);
20
use base qw(Koha::Item);
21
21
22
=head1 NAME
22
=head1 NAME
23
23
Lines 31-36 Koha::Old::Item - Koha Old::Item Object class Link Here
31
31
32
=head2 Internal methods
32
=head2 Internal methods
33
33
34
=head3 biblio
35
36
my $biblio = $item->biblio;
37
38
Return the bibliographic record of this item
39
40
=cut
41
42
sub biblio {
43
    my ($self) = @_;
44
    my $biblio_rs = $self->_result->biblio;
45
    return Koha::Biblio->_new_from_dbic($biblio_rs);
46
}
47
34
=head3 _type
48
=head3 _type
35
49
36
=cut
50
=cut
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/readingrec.tt (-1 / +1 lines)
Lines 80-86 Link Here
80
                </thead>
80
                </thead>
81
                <tbody>
81
                <tbody>
82
                    [% FOREACH checkout IN all_checkouts %]
82
                    [% FOREACH checkout IN all_checkouts %]
83
                        [% SET item = checkout.item %]
83
                        [% SET item = checkout.item || checkout.deleted_item %]
84
                        [% SET biblio = item.biblio %]
84
                        [% SET biblio = item.biblio %]
85
                        <tr>
85
                        <tr>
86
                            <td>
86
                            <td>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt (-6 / +3 lines)
Lines 133-139 Link Here
133
        </thead>
133
        </thead>
134
        <tbody>
134
        <tbody>
135
            [% FOREACH checkout IN checkouts %]
135
            [% FOREACH checkout IN checkouts %]
136
                [% SET item = checkout.item %]
136
                [% SET item = checkout.item || checkout.deleted_item %]
137
                [% SET biblio = item.biblio %]
137
                [% SET biblio = item.biblio %]
138
                <tr>
138
                <tr>
139
                    <td style="display:none;">
139
                    <td style="display:none;">
Lines 185-198 Link Here
185
                        [% END %]
185
                        [% END %]
186
                    </td>
186
                    </td>
187
                    <td>
187
                    <td>
188
                        [% IF item %]
188
                        [% INCLUDE 'biblio-title.inc' biblio=biblio, link => 1 %]
189
                            [% INCLUDE 'biblio-title.inc' biblio=biblio, link => 1 %]
189
                        [% UNLESS item.deleted_on %]
190
                            [% IF ( Koha.Preference( 'OpacStarRatings' ) == 'all' ) %]
190
                            [% IF ( Koha.Preference( 'OpacStarRatings' ) == 'all' ) %]
191
                                [% SET ratings = {ratings => biblio.ratings, itemnumber => item.itemnumber, biblionumber => biblio.biblionumber, my_rating => biblio.ratings.search( borrowernumber => logged_in_user.borrowernumber ).next } %]
191
                                [% SET ratings = {ratings => biblio.ratings, itemnumber => item.itemnumber, biblionumber => biblio.biblionumber, my_rating => biblio.ratings.search( borrowernumber => logged_in_user.borrowernumber ).next } %]
192
                                [% INCLUDE 'user-star-ratings.inc' item=ratings %]
192
                                [% INCLUDE 'user-star-ratings.inc' item=ratings %]
193
                            [% END %]
193
                            [% END %]
194
                        [% ELSE %]
195
                            <span>The item has been deleted</span>
196
                        [% END %]
194
                        [% END %]
197
                    </td>
195
                    </td>
198
                    <td>[% biblio.author | html %]</td>
196
                    <td>[% biblio.author | html %]</td>
199
- 

Return to bug 40704