@@ -, +, @@ --- Koha/Item.pm | 44 ++++++++++++++++++++++ .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) --- a/Koha/Item.pm +++ a/Koha/Item.pm @@ -26,6 +26,8 @@ use Koha::Database; use Koha::Patrons; use Koha::Libraries; +use C4::Circulation qw( GetTransfers ); + use base qw(Koha::Object); =head1 NAME @@ -107,6 +109,48 @@ sub last_returned_by { } } +=head3 is_in_transit + +my $transfer_date = $item->is_in_transit(); + +=cut + +sub is_in_transit { + my ($self) = @_; + + my ($when) = GetTransfers( $self->id ); + + return $when; +} + +=head3 in_transit_to + +my $library_id = $item->in_transit_to(); + +=cut + +sub in_transit_to { + my ($self) = @_; + + my ( undef, undef, $to ) = GetTransfers( $self->id ); + + return $to; +} + +=head3 in_transit_from + +my $library_id = $item->in_transit_from(); + +=cut + +sub in_transit_from { + my ($self) = @_; + + my ( undef, $from ) = GetTransfers( $self->id ); + + return $from; +} + =head3 type =cut --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -604,7 +604,7 @@ [% END %] [% ELSE %] [% IF ( RESERVE.is_in_transit ) %] - Item in transit from [% RESERVE.frombranch %] since + Item in transit from [% Branches.GetName( RESERVE.item.in_transit_from ) %] since [% RESERVE.datesent | $KohaDates %] [% ELSIF ( RESERVE.suspend ) %] Suspended [% IF ( RESERVE.suspend_until ) %] until [% RESERVE.suspend_until %] [% END %] --