Bug 33955: Koha::Biblio::normalized_upc
Signed-off-by: Chris Cormack <chris@bigballofwax.co.nz> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
284aa1496e
commit
bf515ec6d4
|
|
@ -581,6 +581,8 @@ sub display_marc_indicators {
|
|||
sub GetNormalizedUPC {
|
||||
my ($marcrecord,$marcflavour) = @_;
|
||||
|
||||
$marcflavour ||= C4::Context->preference('marcflavour');
|
||||
|
||||
return unless $marcrecord;
|
||||
if ($marcflavour eq 'UNIMARC') {
|
||||
my @fields = $marcrecord->field('072');
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ use List::MoreUtils qw( any );
|
|||
use URI;
|
||||
use URI::Escape qw( uri_escape_utf8 );
|
||||
|
||||
use C4::Koha qw( GetNormalizedISBN );
|
||||
use C4::Koha qw( GetNormalizedISBN GetNormalizedUPC );
|
||||
|
||||
use Koha::Database;
|
||||
use Koha::DateUtils qw( dt_from_string );
|
||||
|
|
@ -1280,6 +1280,20 @@ sub public_read_list {
|
|||
];
|
||||
}
|
||||
|
||||
=head3 normalized_upc
|
||||
|
||||
my $normalized_upc = $biblio->normalized_upc
|
||||
|
||||
Normalizes and returns the UPC value found in the MARC record.
|
||||
|
||||
=cut
|
||||
|
||||
sub normalized_upc {
|
||||
my ($self) = @_;
|
||||
my $marc_record = $self->metadata->record;
|
||||
return C4::Koha::GetNormalizedUPC($marc_record);
|
||||
}
|
||||
|
||||
=head3 to_api
|
||||
|
||||
my $json = $biblio->to_api;
|
||||
|
|
|
|||
Loading…
Reference in New Issue