@@ -, +, @@ waiting hold line. --- Koha/Biblio.pm | 13 +++ Koha/Hold.pm | 25 ++++++ .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 54 ++++++++------ opac/opac-user.pl | 79 ++------------------ 4 files changed, 78 insertions(+), 93 deletions(-) --- a/Koha/Biblio.pm +++ a/Koha/Biblio.pm @@ -21,6 +21,8 @@ use Modern::Perl; use Carp; +use C4::Biblio qw( GetRecordValue GetMarcBiblio GetFrameworkCode ); + use Koha::Database; use base qw(Koha::Object); @@ -35,6 +37,17 @@ Koha::Biblio - Koha Biblio Object class =cut +=head3 subtitle + +=cut + +sub subtitle { + my ( $self ) = @_; + + return GetRecordValue( 'subtitle', GetMarcBiblio( $self->id() ), GetFrameworkCode( $self->id() ) ); +} + + =head3 type =cut --- a/Koha/Hold.pm +++ a/Koha/Hold.pm @@ -91,6 +91,19 @@ sub is_waiting { return $self->found() eq 'W'; } +=head3 is_cancelable + +Returns true if hold is a cancelable hold + +=cut + +sub is_cancelable { + my ($self) = @_; + + return ( $self->is_waiting() && !$self->is_found() ) + || ( !$self->is_waiting() && !$self->is_in_transit() ); +} + =head3 is_in_transit Returns true if hold is a in_transit hold @@ -104,6 +117,18 @@ sub is_in_transit { return $self->found() eq 'T'; } +=head3 is_at_destination + +Returns true if hold is a in_transit hold + +=cut + +sub is_at_destination { + my ($self) = @_; + + return $self->is_waiting() && ( $self->branchcode() eq $self->item()->holdingbranch() ); +} + =head3 biblio Returns the related Koha::Biblio object for this hold --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -511,9 +511,9 @@
[% FOREACH RESERVE IN RESERVES %] - [% IF ( RESERVE.wait ) %] - [% IF ( RESERVE.atdestination ) %] - [% IF ( RESERVE.found ) %] + [% IF ( RESERVE.is_waiting ) %] + [% IF ( RESERVE.is_at_destination ) %] + [% IF ( RESERVE.is_found ) %]