View | Details | Raw Unified | Return to bug 13918
Collapse All | Expand All

(-)a/Koha/Biblio.pm (-3 / +9 lines)
Lines 37-50 Koha::Biblio - Koha Biblio Object class Link Here
37
37
38
=cut
38
=cut
39
39
40
=head3 subtitle
40
=head3 subtitles
41
42
my @subtitles = $biblio->subtitles();
43
44
Returns list of subtitles for a record.
45
46
Keyword to MARC mapping for subtitle must be set for this method to return any possible values.
41
47
42
=cut
48
=cut
43
49
44
sub subtitle {
50
sub subtitles {
45
    my ( $self ) = @_;
51
    my ( $self ) = @_;
46
52
47
    return GetRecordValue( 'subtitle', GetMarcBiblio( $self->id() ), GetFrameworkCode( $self->id() ) );
53
    return map { $_->{subfield} } @{ GetRecordValue( 'subtitle', GetMarcBiblio( $self->id ), $self->frameworkcode ) };
48
}
54
}
49
55
50
56
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-4 / +4 lines)
Lines 536-543 Link Here
536
                                            <td class="title">
536
                                            <td class="title">
537
                                                <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% RESERVE.biblionumber %]">
537
                                                <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% RESERVE.biblionumber %]">
538
                                                    [% RESERVE.biblio.title %]
538
                                                    [% RESERVE.biblio.title %]
539
                                                    [% FOREACH subtitl IN RESERVE.biblio.subtitle %]
539
                                                    [% FOREACH s IN RESERVE.biblio.subtitles %]
540
                                                        [% subtitl.subfield %]
540
                                                        [% s %]
541
                                                    [% END %]
541
                                                    [% END %]
542
                                                    [% RESERVE.item.enumchron %]
542
                                                    [% RESERVE.item.enumchron %]
543
                                                </a>
543
                                                </a>
Lines 621-629 Link Here
621
                                                                        <div class="modal-header">
621
                                                                        <div class="modal-header">
622
                                                                            <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
622
                                                                            <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
623
                                                                            [% IF RESERVE.suspend %]
623
                                                                            [% IF RESERVE.suspend %]
624
                                                                                <h3 id="suspendModal[% RESERVE.reserve_id %]Label">Resume your hold on <i>[% RESERVE.reserves_title %]</i></h3>
624
                                                                                <h3 id="suspendModal[% RESERVE.reserve_id %]Label">Resume your hold on <i>[% RESERVE.biblio.title %]</i></h3>
625
                                                                            [% ELSE %]
625
                                                                            [% ELSE %]
626
                                                                                <h3 id="suspendModal[% RESERVE.reserve_id %]Label">Suspend your hold on <i>[% RESERVE.reserves_title %]</i></h3>
626
                                                                                <h3 id="suspendModal[% RESERVE.reserve_id %]Label">Suspend your hold on <i>[% RESERVE.biblio.title %]</i></h3>
627
                                                                            [% END %]
627
                                                                            [% END %]
628
                                                                        </div>
628
                                                                        </div>
629
                                                                        <div class="modal-body">
629
                                                                        <div class="modal-body">
(-)a/t/db_dependent/BiblioObject.t (-1 / +58 lines)
Line 0 Link Here
0
- 
1
#!/usr/bin/perl
2
3
# This file is part of Koha.
4
#
5
# Koha is free software; you can redistribute it and/or modify it
6
# under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 3 of the License, or
8
# (at your option) any later version.
9
#
10
# Koha is distributed in the hope that it will be useful, but
11
# WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with Koha; if not, see <http://www.gnu.org/licenses>.
17
18
use Modern::Perl;
19
20
use C4::Context;
21
use C4::Biblio qw( AddBiblio );
22
use Koha::Database;
23
use Koha::Branches;
24
use Koha::Borrowers;
25
26
use Test::More tests => 4;
27
28
use_ok('Koha::Biblio');
29
use_ok('Koha::Biblios');
30
31
my $schema = Koha::Database->new()->schema();
32
$schema->storage->txn_begin();
33
34
my $dbh = C4::Context->dbh;
35
$dbh->{RaiseError} = 1;
36
37
my @branches = Koha::Branches->search();
38
my $borrower = Koha::Borrowers->search()->next();
39
40
my $biblio = MARC::Record->new();
41
$biblio->append_fields(
42
    MARC::Field->new( '100', ' ', ' ', a => 'Hall, Kyle' ),
43
    MARC::Field->new( '245', ' ', ' ', a => "Test Record", b => "Test Record Subtitle", b => "Another Test Record Subtitle" ),
44
);
45
my ( $biblionumber, $biblioitemnumber ) = AddBiblio( $biblio, '' );
46
47
my $field_mappings = Koha::Database->new()->schema()->resultset('Fieldmapping');
48
$field_mappings->delete();
49
$field_mappings->create( { field => 'subtitle', fieldcode => '245', subfieldcode => 'b' } );
50
51
$biblio = Koha::Biblios->find( $biblionumber );
52
my @subtitles = $biblio->subtitles();
53
is( $subtitles[0], 'Test Record Subtitle', 'Got first subtitle correctly' );
54
is( $subtitles[1], 'Another Test Record Subtitle', 'Got second subtitle correctly' );
55
56
$schema->storage->txn_rollback();
57
58
1;

Return to bug 13918