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 527-534 Link Here
527
                                            <td class="title">
527
                                            <td class="title">
528
                                                <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% RESERVE.biblionumber %]">
528
                                                <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% RESERVE.biblionumber %]">
529
                                                    [% RESERVE.biblio.title %]
529
                                                    [% RESERVE.biblio.title %]
530
                                                    [% FOREACH subtitl IN RESERVE.biblio.subtitle %]
530
                                                    [% FOREACH s IN RESERVE.biblio.subtitles %]
531
                                                        [% subtitl.subfield %]
531
                                                        [% s %]
532
                                                    [% END %]
532
                                                    [% END %]
533
                                                    [% RESERVE.item.enumchron %]
533
                                                    [% RESERVE.item.enumchron %]
534
                                                </a>
534
                                                </a>
Lines 612-620 Link Here
612
                                                                        <div class="modal-header">
612
                                                                        <div class="modal-header">
613
                                                                            <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
613
                                                                            <button type="button" class="closebtn" data-dismiss="modal" aria-hidden="true">×</button>
614
                                                                            [% IF RESERVE.suspend %]
614
                                                                            [% IF RESERVE.suspend %]
615
                                                                                <h3 id="suspendModal[% RESERVE.reserve_id %]Label">Resume your hold on <i>[% RESERVE.reserves_title %]</i></h3>
615
                                                                                <h3 id="suspendModal[% RESERVE.reserve_id %]Label">Resume your hold on <i>[% RESERVE.biblio.title %]</i></h3>
616
                                                                            [% ELSE %]
616
                                                                            [% ELSE %]
617
                                                                                <h3 id="suspendModal[% RESERVE.reserve_id %]Label">Suspend your hold on <i>[% RESERVE.reserves_title %]</i></h3>
617
                                                                                <h3 id="suspendModal[% RESERVE.reserve_id %]Label">Suspend your hold on <i>[% RESERVE.biblio.title %]</i></h3>
618
                                                                            [% END %]
618
                                                                            [% END %]
619
                                                                        </div>
619
                                                                        </div>
620
                                                                        <div class="modal-body">
620
                                                                        <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