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

(-)a/Koha/Biblio.pm (+19 lines)
Lines 640-645 sub get_openurl { Link Here
640
    return $OpenURLResolverURL;
640
    return $OpenURLResolverURL;
641
}
641
}
642
642
643
=head3 is_serial
644
645
my $serial = $biblio->is_serial
646
647
Return boolean true if this bibbliographic record is continuing resource
648
649
=cut
650
651
sub is_serial {
652
    my ( $self ) = @_;
653
654
    return 1 if $self->serial;
655
656
    my $record = $self->metadata->record;
657
    return 1 if substr($record->leader, 7, 1) eq 's';
658
659
    return 0;
660
}
661
643
=head3 type
662
=head3 type
644
663
645
=cut
664
=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 146-148 subtest 'get_coins and get_openurl' => sub { Link Here
146
146
147
    $schema->storage->txn_rollback;
147
    $schema->storage->txn_rollback;
148
};
148
};
149
- 
149
150
subtest 'is_serial() tests' => sub {
151
152
    plan tests => 3;
153
154
    $schema->storage->txn_begin;
155
156
    my $biblio = $builder->build_sample_biblio();
157
158
    $biblio->serial( 1 )->store->discard_changes;
159
    ok( $biblio->is_serial, 'Bibliographic record is serial' );
160
161
    $biblio->serial( 0 )->store->discard_changes;
162
    ok( !$biblio->is_serial, 'Bibliographic record is not serial' );
163
164
    my $record = $biblio->metadata->record;
165
    $record->leader('00142nas a22     7a 4500');
166
    ModBiblio($record, $biblio->biblionumber );
167
    $biblio = Koha::Biblios->find($biblio->biblionumber);
168
169
    ok( $biblio->is_serial, 'Bibliographic record is serial' );
170
171
    $schema->storage->txn_rollback;
172
};

Return to bug 16284