Lines 3461-3509
sub ModBiblioMarc {
Link Here
|
3461 |
# the previous version of the record |
3461 |
# the previous version of the record |
3462 |
$oldRecord = GetMarcBiblio($biblionumber); |
3462 |
$oldRecord = GetMarcBiblio($biblionumber); |
3463 |
} |
3463 |
} |
3464 |
# |
|
|
3465 |
if (C4::Context->preference("IsbnIssnRemoveHyphens")){ |
3466 |
my $isbn; |
3467 |
my $issn; |
3468 |
if ( $encoding eq 'UNIMARC' ) { |
3469 |
if ( my $f010 = $record->field('010') ) { |
3470 |
if ( $f010->subfield('a') ) { |
3471 |
$isbn = $f010->subfield('a'); |
3472 |
$isbn =~ s/-//g; |
3473 |
$f010->update( 'a' => $isbn ); |
3474 |
} |
3475 |
} |
3476 |
if ( my $f011 = $record->field('011') ) { |
3477 |
if ( $f011->subfield('a') ) { |
3478 |
$issn = $f011->subfield('a'); |
3479 |
$issn =~ s/-//g; |
3480 |
$f011->update( 'a' => $issn ); |
3481 |
} |
3482 |
} |
3483 |
} elsif ($encoding eq 'MARC21') { |
3484 |
if ( my $f020 = $record->field('020') ) { |
3485 |
$isbn = $f020->subfield('a'); |
3486 |
$isbn =~ s/-//g; |
3487 |
$f020->update( 'a' => $isbn ); |
3488 |
} |
3489 |
if ( my $f022 = $record->field('022') ) { |
3490 |
$issn = $f022->subfield('a'); |
3491 |
$issn =~ s/-//g; |
3492 |
$f022->update( 'a' => $issn ); |
3493 |
} |
3494 |
} elsif ($encoding eq 'NORMARC') { |
3495 |
if ( my $f020 = $record->field('020') ) { |
3496 |
$isbn = $f020->subfield('a'); |
3497 |
$isbn =~ s/-//g; |
3498 |
$f020->update( 'a' => $isbn ); |
3499 |
} |
3500 |
if ( my $f022 = $record->field('022') ) { |
3501 |
$issn = $f022->subfield('a'); |
3502 |
$issn =~ s/-//g; |
3503 |
$f022->update( 'a' => $issn ); |
3504 |
} |
3505 |
} |
3506 |
} |
3507 |
$sth = $dbh->prepare("UPDATE biblioitems SET marc=?,marcxml=? WHERE biblionumber=?"); |
3464 |
$sth = $dbh->prepare("UPDATE biblioitems SET marc=?,marcxml=? WHERE biblionumber=?"); |
3508 |
$sth->execute( $record->as_usmarc(), $record->as_xml_record($encoding), $biblionumber ); |
3465 |
$sth->execute( $record->as_usmarc(), $record->as_xml_record($encoding), $biblionumber ); |
3509 |
$sth->finish; |
3466 |
$sth->finish; |