Bug 33958: Koha::Biblio::normalized_oclc
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
69841b192a
commit
3fb6dc40fe
|
|
@ -669,6 +669,8 @@ sub GetNormalizedOCLCNumber {
|
|||
my ($marcrecord,$marcflavour) = @_;
|
||||
return unless $marcrecord;
|
||||
|
||||
$marcflavour ||= C4::Context->preference('marcflavour');
|
||||
|
||||
if ($marcflavour ne 'UNIMARC' ) {
|
||||
my @fields = $marcrecord->field('035');
|
||||
foreach my $field (@fields) {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ use List::MoreUtils qw( any );
|
|||
use URI;
|
||||
use URI::Escape qw( uri_escape_utf8 );
|
||||
|
||||
use C4::Koha qw( GetNormalizedISBN GetNormalizedUPC );
|
||||
use C4::Koha qw( GetNormalizedISBN GetNormalizedUPC GetNormalizedOCLCNumber );
|
||||
|
||||
use Koha::Database;
|
||||
use Koha::DateUtils qw( dt_from_string );
|
||||
|
|
@ -1294,6 +1294,20 @@ sub normalized_upc {
|
|||
return C4::Koha::GetNormalizedUPC($marc_record);
|
||||
}
|
||||
|
||||
=head3 normalized_oclc
|
||||
|
||||
my $normalized_oclc = $biblio->normalized_oclc
|
||||
|
||||
Normalizes and returns the OCLC number found in the MARC record.
|
||||
|
||||
=cut
|
||||
|
||||
sub normalized_oclc {
|
||||
my ( $self ) = @_;
|
||||
my $marc_record = $self->metadata->record;
|
||||
return C4::Koha::GetNormalizedOCLCNumber( $marc_record );
|
||||
}
|
||||
|
||||
=head3 to_api
|
||||
|
||||
my $json = $biblio->to_api;
|
||||
|
|
|
|||
Loading…
Reference in New Issue