Bugzilla – Attachment 92132 Details for
Bug 16284
With CheckPrevCheckout used, check only the item for previous checkout if biblio is serial
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16284: Add Koha::Biblio->is_serial method
Bug-16284-Add-KohaBiblio-isserial-method.patch (text/plain), 2.26 KB, created by
Katrin Fischer
on 2019-08-10 12:38:47 UTC
(
hide
)
Description:
Bug 16284: Add Koha::Biblio->is_serial method
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2019-08-10 12:38:47 UTC
Size:
2.26 KB
patch
obsolete
>From d1161c5ac46d995949ae43ac00bdbbde8876d705 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Thu, 18 Apr 2019 07:19:34 +0000 >Subject: [PATCH] Bug 16284: Add Koha::Biblio->is_serial method > >Test plan: >prove t/db_dependent/Koha/Biblio.t > >should return green > >Signed-off-by: Michal Denar <black23@gmail.com> > >Signed-off-by: Michal Denar <black23@gmail.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > Koha/Biblio.pm | 19 +++++++++++++++++++ > t/db_dependent/Koha/Biblio.t | 26 +++++++++++++++++++++++++- > 2 files changed, 44 insertions(+), 1 deletion(-) > >diff --git a/Koha/Biblio.pm b/Koha/Biblio.pm >index 22adee7505..040126882c 100644 >--- a/Koha/Biblio.pm >+++ b/Koha/Biblio.pm >@@ -640,6 +640,25 @@ sub get_openurl { > return $OpenURLResolverURL; > } > >+=head3 is_serial >+ >+my $serial = $biblio->is_serial >+ >+Return boolean true if this bibbliographic record is continuing resource >+ >+=cut >+ >+sub is_serial { >+ my ( $self ) = @_; >+ >+ return 1 if $self->serial; >+ >+ my $record = $self->metadata->record; >+ return 1 if substr($record->leader, 7, 1) eq 's'; >+ >+ return 0; >+} >+ > =head3 type > > =cut >diff --git a/t/db_dependent/Koha/Biblio.t b/t/db_dependent/Koha/Biblio.t >index 7f04ca1e83..bdf65bd7e2 100644 >--- a/t/db_dependent/Koha/Biblio.t >+++ b/t/db_dependent/Koha/Biblio.t >@@ -17,7 +17,7 @@ > > use Modern::Perl; > >-use Test::More tests => 6; >+use Test::More tests => 7; > > use C4::Biblio; > use Koha::Database; >@@ -146,3 +146,27 @@ subtest 'get_coins and get_openurl' => sub { > > $schema->storage->txn_rollback; > }; >+ >+subtest 'is_serial() tests' => sub { >+ >+ plan tests => 3; >+ >+ $schema->storage->txn_begin; >+ >+ my $biblio = $builder->build_sample_biblio(); >+ >+ $biblio->serial( 1 )->store->discard_changes; >+ ok( $biblio->is_serial, 'Bibliographic record is serial' ); >+ >+ $biblio->serial( 0 )->store->discard_changes; >+ ok( !$biblio->is_serial, 'Bibliographic record is not serial' ); >+ >+ my $record = $biblio->metadata->record; >+ $record->leader('00142nas a22 7a 4500'); >+ ModBiblio($record, $biblio->biblionumber ); >+ $biblio = Koha::Biblios->find($biblio->biblionumber); >+ >+ ok( $biblio->is_serial, 'Bibliographic record is serial' ); >+ >+ $schema->storage->txn_rollback; >+}; >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16284
:
88050
|
88051
|
88236
|
88237
|
88258
|
88259
|
90642
|
90643
|
90644
|
90645
|
90646
|
90647
|
90648
|
90649
|
92130
|
92131
| 92132 |
92133