Lines 457-463
sub _isbn_replace {
Link Here
|
457 |
|
457 |
|
458 |
ImportBreedingAuth($marcrecords,$overwrite_auth,$filename,$encoding,$z3950random,$batch_type); |
458 |
ImportBreedingAuth($marcrecords,$overwrite_auth,$filename,$encoding,$z3950random,$batch_type); |
459 |
|
459 |
|
460 |
TODO description |
460 |
ImportBreedingAuth imports MARC records in the reservoir (import_records table). |
|
|
461 |
ImportBreedingAuth is based on the ImportBreeding subroutine. |
461 |
|
462 |
|
462 |
=cut |
463 |
=cut |
463 |
|
464 |
|
Lines 485-494
sub ImportBreedingAuth {
Link Here
|
485 |
# Normalize the record so it doesn't have separated diacritics |
486 |
# Normalize the record so it doesn't have separated diacritics |
486 |
SetUTF8Flag($marcrecord); |
487 |
SetUTF8Flag($marcrecord); |
487 |
|
488 |
|
488 |
# warn "$i : $marcarray[$i]"; |
|
|
489 |
# FIXME - currently this does nothing |
490 |
my @warnings = $marcrecord->warnings(); |
491 |
|
492 |
if (scalar($marcrecord->fields()) == 0) { |
489 |
if (scalar($marcrecord->fields()) == 0) { |
493 |
$notmarcrecord++; |
490 |
$notmarcrecord++; |
494 |
} else { |
491 |
} else { |
Lines 509-518
sub ImportBreedingAuth {
Link Here
|
509 |
|
506 |
|
510 |
if ($duplicateauthid && $overwrite_auth ne 2) { |
507 |
if ($duplicateauthid && $overwrite_auth ne 2) { |
511 |
#If the authority record exists and $overwrite_auth doesn't equal 2, then mark it as already in the DB |
508 |
#If the authority record exists and $overwrite_auth doesn't equal 2, then mark it as already in the DB |
512 |
#FIXME: What does $overwrite_auth = 2 even mean? |
|
|
513 |
|
514 |
#FIXME: Should we bother with $overwrite_auth values? Currently, the hard-coded $overwrite_auth value is 2, which means the database gets filled with import_records... |
515 |
#^^ of course, we might not want to reject records if their control number/heading exist in the db or breeding/import pool...as we might be wanting to update existing authority records... |
516 |
$alreadyindb++; |
509 |
$alreadyindb++; |
517 |
} else { |
510 |
} else { |
518 |
if ($controlnumber && $heading) { |
511 |
if ($controlnumber && $heading) { |
Lines 520-530
sub ImportBreedingAuth {
Link Here
|
520 |
($breedingid) = $searchbreeding->fetchrow; |
513 |
($breedingid) = $searchbreeding->fetchrow; |
521 |
} |
514 |
} |
522 |
if ($breedingid && $overwrite_auth eq '0') { |
515 |
if ($breedingid && $overwrite_auth eq '0') { |
523 |
#FIXME: What does $overwrite_auth = 0 even mean? |
|
|
524 |
$alreadyinfarm++; |
516 |
$alreadyinfarm++; |
525 |
} else { |
517 |
} else { |
526 |
if ($breedingid && $overwrite_auth eq '1') { |
518 |
if ($breedingid && $overwrite_auth eq '1') { |
527 |
#FIXME: What does $overwrite_auth = 1 even mean? |
|
|
528 |
ModAuthorityInBatch($breedingid, $marcrecord); |
519 |
ModAuthorityInBatch($breedingid, $marcrecord); |
529 |
} else { |
520 |
} else { |
530 |
my $import_id = AddAuthToBatch($batch_id, $imported, $marcrecord, $encoding, $z3950random); |
521 |
my $import_id = AddAuthToBatch($batch_id, $imported, $marcrecord, $encoding, $z3950random); |