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

(-)a/Koha/Biblio.pm (+19 lines)
Lines 467-472 sub has_items_waiting_or_intransit { Link Here
467
    return 0;
467
    return 0;
468
}
468
}
469
469
470
=head3 is_serial
471
472
my $serial = $biblio->is_serial
473
474
Return boolean true if this bibbliographic record is continuing resource
475
476
=cut
477
478
sub is_serial {
479
    my ( $self ) = @_;
480
481
    return 1 if $self->serial;
482
483
    my $record = $self->metadata->record;
484
    return 1 if substr($record->leader, 7, 1) eq 's';
485
486
    return 0;
487
}
488
470
=head3 type
489
=head3 type
471
490
472
=cut
491
=cut
(-)a/t/db_dependent/Koha/Biblio.t (-2 / +26 lines)
Lines 17-23 Link Here
17
17
18
use Modern::Perl;
18
use Modern::Perl;
19
19
20
use Test::More tests => 4;
20
use Test::More tests => 5;
21
21
22
use t::lib::TestBuilder;
22
use t::lib::TestBuilder;
23
23
Lines 86-88 subtest 'hidden_in_opac() tests' => sub { Link Here
86
86
87
    $schema->storage->txn_rollback;
87
    $schema->storage->txn_rollback;
88
};
88
};
89
- 
89
90
subtest 'is_serial() tests' => sub {
91
92
    plan tests => 3;
93
94
    $schema->storage->txn_begin;
95
96
    my $biblio = $builder->build_sample_biblio();
97
98
    $biblio->serial( 1 )->store->discard_changes;
99
    ok( $biblio->is_serial, 'Bibliographic record is serial' );
100
101
    $biblio->serial( 0 )->store->discard_changes;
102
    ok( !$biblio->is_serial, 'Bibliographic record is not serial' );
103
104
    my $record = $biblio->metadata->record;
105
    $record->leader('00142nas a22     7a 4500');
106
    ModBiblio($record, $biblio->biblionumber );
107
    $biblio = Koha::Biblios->find($biblio->biblionumber);
108
109
    ok( $biblio->is_serial, 'Bibliographic record is serial' );
110
111
    $schema->storage->txn_rollback;
112
};
113

Return to bug 16284