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

(-)a/Koha/Schema/Result/OldReserve.pm (+24 lines)
Lines 324-329 __PACKAGE__->belongs_to( Link Here
324
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-11-06 11:00:40
324
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2020-11-06 11:00:40
325
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7weIpuc0RpZ/MxFn94E8dg
325
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7weIpuc0RpZ/MxFn94E8dg
326
326
327
__PACKAGE__->belongs_to(
328
  "item",
329
  "Koha::Schema::Result::Item",
330
  { itemnumber => "itemnumber" },
331
  {
332
    is_deferrable => 1,
333
    join_type     => "LEFT",
334
    on_delete     => "CASCADE",
335
    on_update     => "CASCADE",
336
  },
337
);
338
339
__PACKAGE__->belongs_to(
340
  "biblio",
341
  "Koha::Schema::Result::Biblio",
342
  { biblionumber => "biblionumber" },
343
  {
344
    is_deferrable => 1,
345
    join_type     => "LEFT",
346
    on_delete     => "CASCADE",
347
    on_update     => "CASCADE",
348
  },
349
);
350
327
__PACKAGE__->add_columns(
351
__PACKAGE__->add_columns(
328
    '+item_level_hold' => { is_boolean => 1 },
352
    '+item_level_hold' => { is_boolean => 1 },
329
    '+lowestPriority'  => { is_boolean => 1 },
353
    '+lowestPriority'  => { is_boolean => 1 },
(-)a/opac/opac-holdshistory.pl (-11 / +22 lines)
Lines 24-29 use C4::Auth; Link Here
24
use C4::Output;
24
use C4::Output;
25
25
26
use Koha::Patrons;
26
use Koha::Patrons;
27
use Koha::Holds;
28
use Koha::Old::Holds;
27
29
28
my $query = CGI->new;
30
my $query = CGI->new;
29
my @all_holds;
31
my @all_holds;
Lines 42-51 my ( $template, $patron_id, $cookie ) = get_template_and_user( Link Here
42
    }
44
    }
43
);
45
);
44
46
45
my $patron = Koha::Patrons->find( $patron_id );
47
my $patron = Koha::Patrons->find($patron_id);
46
48
47
my $holds = $patron->holds;
49
my $sort = $query->param('sort');
48
my $old_holds = $patron->old_holds;
50
$sort = 'reservedate' unless $sort;
51
52
my $unlimit = $query->param('unlimit');
53
my $ops = {
54
    prefetch => ['biblio', 'item'],
55
    order_by => $sort
56
};
57
58
$ops->{rows} = 50 unless $unlimit;
59
60
my $holds = Koha::Holds->search({
61
    borrowernumber => $patron_id
62
}, $ops);
63
64
my $old_holds = Koha::Old::Holds->search({
65
    borrowernumber => $patron_id
66
}, $ops);
49
67
50
while (my $hold = $holds->next) {
68
while (my $hold = $holds->next) {
51
    push @all_holds, $hold;
69
    push @all_holds, $hold;
Lines 55-73 while (my $hold = $old_holds->next) { Link Here
55
    push @all_holds, $hold;
73
    push @all_holds, $hold;
56
}
74
}
57
75
58
my $sort = $query->param('sort');
59
60
$sort = 'reservedate' unless $sort;
61
62
if($sort eq 'reservedate') {
76
if($sort eq 'reservedate') {
63
    @all_holds = sort {$b->$sort cmp $a->$sort} @all_holds;
77
    @all_holds = sort {$b->$sort cmp $a->$sort} @all_holds;
64
} else {
78
} else {
65
    my ($obj, $col) = split /\./, $sort;
79
    my ($obj, $col) = split /\./, $sort;
66
    @all_holds = sort {$a->$obj->$col cmp $b->$obj->$col} @all_holds;
80
    @all_holds = sort { ( $a->$obj && $a->$obj->$col || '' ) cmp ( $b->$obj && $b->$obj->$col || '' ) } @all_holds;
67
}
81
}
68
82
69
my $unlimit = $query->param('unlimit');
70
71
unless($unlimit) {
83
unless($unlimit) {
72
    @all_holds = splice(@all_holds, 0, 50);
84
    @all_holds = splice(@all_holds, 0, 50);
73
}
85
}
74
- 

Return to bug 20936