Bug 19935: Replace GetPendingIssues - opac-user.pl

At first glance we just need the biblio title and the subtitle (in
addition of the fines info), we should not need the prefetch.

Test plan:
Loggin at the OPAC, on the summary page you should see your checkouts
and overdues with the correct values

Signed-off-by: Benjamin Rokseth <benjamin.rokseth@deichman.no>

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2018-01-08 11:59:29 -03:00
parent 83082242a5
commit a53471e8bb
2 changed files with 8 additions and 7 deletions

View File

@ -246,14 +246,14 @@ Using this account is not recommended because some parts of Koha will not functi
<td class="date_due overdue">
<span title="[% ISSUE.date_due %]">
<span class="tdlabel">Date due:</span>
[% ISSUE.date_due_sql | $KohaDates as_due_date => 1 %]
[% ISSUE.date_due | $KohaDates as_due_date => 1 %]
</span>
</td>
[% ELSE %]
<td class="date_due">
<span title="[% ISSUE.date_due %]">
<span class="tdlabel">Date due:</span>
[% ISSUE.date_due_sql | $KohaDates as_due_date => 1 %]
[% ISSUE.date_due | $KohaDates as_due_date => 1 %]
</span>
</td>
[% END %]
@ -540,7 +540,7 @@ Using this account is not recommended because some parts of Koha will not functi
<td>
<span title="[% OVERDUE.date_due %]">
<span class="tdlabel">Date due:</span>
[% OVERDUE.date_due_sql | $KohaDates as_due_date => 1 %]
[% OVERDUE.date_due | $KohaDates as_due_date => 1 %]
</span>
</td>
[% IF ( OpacRenewalAllowed ) %]

View File

@ -184,9 +184,10 @@ my $overdues_count = 0;
my @overdues;
my @issuedat;
my $itemtypes = { map { $_->{itemtype} => $_ } @{ Koha::ItemTypes->search_with_localization->unblessed } };
my $issues = GetPendingIssues($borrowernumber);
if ($issues){
foreach my $issue ( sort { $b->{date_due}->datetime() cmp $a->{date_due}->datetime() } @{$issues} ) {
my $pending_checkouts = $patron->pending_checkouts({}, { order_by => [ { -desc => 'date_due' }, { -asc => 'issue_id' } ] });
if ( $pending_checkouts->count ) { # Useless test
while ( my $c = $pending_checkouts->next ) {
my $issue = $c->unblessed_all_relateds;
# check for reserves
my $restype = GetReserveStatus( $issue->{'itemnumber'} );
if ( $restype ) {
@ -251,7 +252,7 @@ if ($issues){
}
}
if ( $issue->{'overdue'} ) {
if ( $c->is_overdue ) {
push @overdues, $issue;
$overdues_count++;
$issue->{'overdue'} = 1;