@@ -, +, @@ --- Koha/Biblio.pm | 12 +++- .../opac-tmpl/bootstrap/en/modules/opac-user.tt | 8 ++-- t/db_dependent/BiblioObject.t | 58 ++++++++++++++++++++ 3 files changed, 71 insertions(+), 7 deletions(-) create mode 100755 t/db_dependent/BiblioObject.t --- a/Koha/Biblio.pm +++ a/Koha/Biblio.pm @@ -37,14 +37,20 @@ Koha::Biblio - Koha Biblio Object class =cut -=head3 subtitle +=head3 subtitles + +my @subtitles = $biblio->subtitles(); + +Returns list of subtitles for a record. + +Keyword to MARC mapping for subtitle must be set for this method to return any possible values. =cut -sub subtitle { +sub subtitles { my ( $self ) = @_; - return GetRecordValue( 'subtitle', GetMarcBiblio( $self->id() ), GetFrameworkCode( $self->id() ) ); + return map { $_->{subfield} } @{ GetRecordValue( 'subtitle', GetMarcBiblio( $self->id ), $self->frameworkcode ) }; } --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt @@ -536,8 +536,8 @@ [% RESERVE.biblio.title %] - [% FOREACH subtitl IN RESERVE.biblio.subtitle %] - [% subtitl.subfield %] + [% FOREACH s IN RESERVE.biblio.subtitles %] + [% s %] [% END %] [% RESERVE.item.enumchron %] @@ -621,9 +621,9 @@