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

(-)a/Koha/Old/Checkout.pm (+32 lines)
Lines 21-26 use Koha::Database; Link Here
21
21
22
use base qw(Koha::Object);
22
use base qw(Koha::Object);
23
23
24
=head3 item
25
26
my $item = $checkout->item;
27
28
Return the checked out item
29
30
=cut
31
32
sub item {
33
    my ( $self ) = @_;
34
    my $item_rs = $self->_result->item;
35
    return Koha::Item->_new_from_dbic( $item_rs );
36
}
37
38
=head3 patron
39
40
my $patron = $checkout->patron
41
42
Return the patron for who the checkout has been done
43
44
=cut
45
46
sub patron {
47
    my ( $self ) = @_;
48
    my $patron_rs = $self->_result->borrower;
49
    return Koha::Patron->_new_from_dbic( $patron_rs );
50
}
51
52
53
54
55
24
sub _type {
56
sub _type {
25
    return 'OldIssue';
57
    return 'OldIssue';
26
}
58
}
(-)a/Koha/Schema/Result/OldIssue.pm (+19 lines)
Lines 229-234 __PACKAGE__->belongs_to( Link Here
229
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:54
229
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:54
230
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RKLeDDEz22G5BU/ZAl7QLA
230
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RKLeDDEz22G5BU/ZAl7QLA
231
231
232
__PACKAGE__->belongs_to(
233
    "borrower",
234
    "Koha::Schema::Result::Borrower",
235
    { borrowernumber => "borrowernumber" },
236
    { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" },
237
);
238
239
__PACKAGE__->belongs_to(
240
  "item",
241
  "Koha::Schema::Result::Item",
242
  { itemnumber => "itemnumber" },
243
  {
244
    is_deferrable => 1,
245
    join_type     => "LEFT",
246
    on_delete     => "CASCADE",
247
    on_update     => "CASCADE",
248
  },
249
);
250
232
sub koha_objects_class {
251
sub koha_objects_class {
233
    'Koha::Old::Checkouts';
252
    'Koha::Old::Checkouts';
234
}
253
}
(-)a/catalogue/issuehistory.pl (-2 / +11 lines)
Lines 25-30 use C4::Output; Link Here
25
use C4::Biblio;    # GetBiblio
25
use C4::Biblio;    # GetBiblio
26
use C4::Search;		# enabled_staff_search_views
26
use C4::Search;		# enabled_staff_search_views
27
use Koha::Checkouts;
27
use Koha::Checkouts;
28
use Koha::Old::Checkouts;
28
29
29
use Koha::Biblios;
30
use Koha::Biblios;
30
31
Lines 41-57 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
41
42
42
my $biblionumber = $query->param('biblionumber');
43
my $biblionumber = $query->param('biblionumber');
43
44
44
my $checkouts = Koha::Checkouts->search(
45
my @checkouts = Koha::Checkouts->search(
45
    { biblionumber => $biblionumber },
46
    { biblionumber => $biblionumber },
46
    {
47
    {
47
        join       => 'item',
48
        join       => 'item',
48
        order_by   => 'timestamp',
49
        order_by   => 'timestamp',
49
    }
50
    }
50
);
51
);
52
my @old_checkouts = Koha::Old::Checkouts->search(
53
    { biblionumber => $biblionumber },
54
    {
55
        join       => 'item',
56
        order_by   => 'timestamp',
57
    }
58
);
59
51
my $biblio = Koha::Biblios->find( $biblionumber );
60
my $biblio = Koha::Biblios->find( $biblionumber );
52
61
53
$template->param(
62
$template->param(
54
    checkouts => $checkouts,
63
    checkouts => [ @checkouts, @old_checkouts ],
55
    biblio    => $biblio,
64
    biblio    => $biblio,
56
	issuehistoryview => 1,
65
	issuehistoryview => 1,
57
	C4::Search::enabled_staff_search_views,
66
	C4::Search::enabled_staff_search_views,
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt (-3 / +2 lines)
Lines 26-33 Link Here
26
[% IF biblio.author %]<h3>by [% biblio.author %]</h3>[% END %]
26
[% IF biblio.author %]<h3>by [% biblio.author %]</h3>[% END %]
27
27
28
<div class="searchresults">
28
<div class="searchresults">
29
    [% IF checkouts.count %]
29
    [% IF checkouts %]
30
        <h4>Checked out [% checkouts.count %] times</h4>
30
        <h4>Checked out [% checkouts %] times</h4>
31
        <table id="table_issues">
31
        <table id="table_issues">
32
            <thead><tr>
32
            <thead><tr>
33
            [% IF Koha.Preference('intranetreadinghistory') AND CAN_user_circulate_circulate_remaining_permissions %]
33
            [% IF Koha.Preference('intranetreadinghistory') AND CAN_user_circulate_circulate_remaining_permissions %]
34
- 

Return to bug 20934