|
Lines 502-507
sub ImportBreedingAuth {
Link Here
|
| 502 |
my $batch_id = GetZ3950BatchId($filename); |
502 |
my $batch_id = GetZ3950BatchId($filename); |
| 503 |
my $searchbreeding = $dbh->prepare("select import_record_id from import_auths where control_number=? and authorized_heading=?"); |
503 |
my $searchbreeding = $dbh->prepare("select import_record_id from import_auths where control_number=? and authorized_heading=?"); |
| 504 |
|
504 |
|
|
|
505 |
my $marc_type = shift || C4::Context->preference('marcflavour'); |
| 506 |
|
| 505 |
my $controlnumber = $marcrecord->field('001')->data; |
507 |
my $controlnumber = $marcrecord->field('001')->data; |
| 506 |
|
508 |
|
| 507 |
# Normalize the record so it doesn't have separated diacritics |
509 |
# Normalize the record so it doesn't have separated diacritics |
|
Lines 510-516
sub ImportBreedingAuth {
Link Here
|
| 510 |
$searchbreeding->execute($controlnumber,$heading); |
512 |
$searchbreeding->execute($controlnumber,$heading); |
| 511 |
my ($breedingid) = $searchbreeding->fetchrow; |
513 |
my ($breedingid) = $searchbreeding->fetchrow; |
| 512 |
|
514 |
|
| 513 |
return $breedingid if $breedingid; |
515 |
if ($breedingid) |
|
|
516 |
{ |
| 517 |
my $updbrd = $dbh->prepare("update import_records set marc=?,marcxml=? where import_record_id=?"); |
| 518 |
$updbrd->execute($marcrecord->as_usmarc(),$marcrecord->as_xml($marc_type),$breedingid); |
| 519 |
$updbrd->finish(); |
| 520 |
return $breedingid; |
| 521 |
} |
| 514 |
$breedingid = AddAuthToBatch($batch_id, 0, $marcrecord, $encoding); |
522 |
$breedingid = AddAuthToBatch($batch_id, 0, $marcrecord, $encoding); |
| 515 |
return $breedingid; |
523 |
return $breedingid; |
| 516 |
} |
524 |
} |
| 517 |
- |
|
|