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

(-)a/Koha/Biblio.pm (+19 lines)
Lines 656-661 sub get_openurl { Link Here
656
    return $OpenURLResolverURL;
656
    return $OpenURLResolverURL;
657
}
657
}
658
658
659
=head3 is_serial
660
661
my $serial = $biblio->is_serial
662
663
Return boolean true if this bibbliographic record is continuing resource
664
665
=cut
666
667
sub is_serial {
668
    my ( $self ) = @_;
669
670
    return 1 if $self->serial;
671
672
    my $record = $self->metadata->record;
673
    return 1 if substr($record->leader, 7, 1) eq 's';
674
675
    return 0;
676
}
677
659
=head3 type
678
=head3 type
660
679
661
=cut
680
=cut
(-)a/t/db_dependent/Koha/Biblio.t (-2 / +25 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 6;
20
use Test::More tests => 7;
21
21
22
use C4::Biblio;
22
use C4::Biblio;
23
use Koha::Database;
23
use Koha::Database;
Lines 143-145 subtest 'get_coins and get_openurl' => sub { Link Here
143
143
144
    $schema->storage->txn_rollback;
144
    $schema->storage->txn_rollback;
145
};
145
};
146
- 
146
147
subtest 'is_serial() tests' => sub {
148
149
    plan tests => 3;
150
151
    $schema->storage->txn_begin;
152
153
    my $biblio = $builder->build_sample_biblio();
154
155
    $biblio->serial( 1 )->store->discard_changes;
156
    ok( $biblio->is_serial, 'Bibliographic record is serial' );
157
158
    $biblio->serial( 0 )->store->discard_changes;
159
    ok( !$biblio->is_serial, 'Bibliographic record is not serial' );
160
161
    my $record = $biblio->metadata->record;
162
    $record->leader('00142nas a22     7a 4500');
163
    ModBiblio($record, $biblio->biblionumber );
164
    $biblio = Koha::Biblios->find($biblio->biblionumber);
165
166
    ok( $biblio->is_serial, 'Bibliographic record is serial' );
167
168
    $schema->storage->txn_rollback;
169
};

Return to bug 16284