From 127d2b59010ae07799c3ae18aef348280b631878 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 8 Jan 2018 11:47:46 -0300 Subject: [PATCH] Bug 19935: Replace GetPendingIssues - opac-ics.pl We only need the biblio title and the barcode, we should not need the whole prefetch. Test plan: On your OPAC summary page export your checkout list using the "Download as iCal/.ics file" link. Before and after the patchset, the generated files must be the same Signed-off-by: Benjamin Rokseth --- opac/opac-ics.pl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/opac/opac-ics.pl b/opac/opac-ics.pl index c4da67e..1fbf351 100755 --- a/opac/opac-ics.pl +++ b/opac/opac-ics.pl @@ -50,13 +50,15 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( # Create Calendar my $calendar = Data::ICal->new(); -# get issued items .... -my $issues = GetPendingIssues($borrowernumber); +my $patron = Koha::Patrons->find( $borrowernumber ); +my $pending_checkouts = $patron->pending_checkouts; -foreach my $issue ( @$issues ) { +while ( my $c = $pending_checkouts->next ) { + my $issue = $c->unblessed_all_relateds; my $vevent = Data::ICal::Entry::Event->new(); my $timestamp = DateTime->now(); # Defaults to UTC # Send some values to the template to generate summary and description + $issue->{overdue} = $c->is_overdue; $template->param( overdue => $issue->{'overdue'}, title => $issue->{'title'}, -- 2.1.4