From dccb727d3ff2232552a737b37cca46d6d4139428 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 3 Jan 2023 11:02:37 +0100 Subject: [PATCH] Bug 32445: Fix availability display on opac-course-details Signed-off-by: David Nind Signed-off-by: Martin Renvoize Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi --- koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc | 7 +++++-- .../opac-tmpl/bootstrap/en/modules/opac-course-details.tt | 2 +- opac/opac-course-details.pl | 5 +---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc index ca13bac71c..fc457e816b 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/item-status.inc @@ -39,8 +39,11 @@ Checked out [% END %] [% END %] - [%# FIXME We should move avail_for_recall to a Koha::Item method %] - [% IF !item.isa('Koha::Item') AND item.avail_for_recall %]Recall[% END %] + [% IF show_recall_link %] + [% IF datedue && logged_in_user.borrowernumber != issue.borrowernumber %] + Recall + [% END %] + [% END %] [% END %] [% IF item.isa('Koha::Item') %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt index 0f1e97c980..8e4aa87c01 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt @@ -87,7 +87,7 @@ [% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.ccode', authorised_value => cr.item.ccode, opac => 1 ) | html %] [% cr.item.itemcallnumber | html %] [% cr.item.copynumber | html %] - [% INCLUDE 'item-status.inc' item=cr.course_item issue=cr.issue %] + [% INCLUDE 'item-status.inc' item=cr.course_item issue=cr.issue show_recall_link=1 %] [% cr.issue.date_due | $KohaDates as_due_date => 1 %] [% IF ( cr.public_note ) %] [% cr.public_note | $raw %] diff --git a/opac/opac-course-details.pl b/opac/opac-course-details.pl index 48b5b9f746..6154549c06 100755 --- a/opac/opac-course-details.pl +++ b/opac/opac-course-details.pl @@ -46,10 +46,7 @@ my $course_reserves = GetCourseReserves( course_id => $course_id, include_items if ( C4::Context->preference('UseRecalls') ) { foreach my $cr ( @$course_reserves ) { - if ( $cr->{issue}->{date_due} and $cr->{issue}->{borrowernumber} and $borrowernumber != $cr->{issue}->{borrowernumber} ) { - $cr->{course_item}->{avail_for_recall} = 1; - $cr->{course_item}->{biblionumber} = Koha::Items->find( $cr->{itemnumber} )->biblionumber; - } + $cr->{course_item} = Koha::Items->find($cr->{itemnumber}); } } -- 2.39.5