From: Bill Erickson Date: Thu, 27 Oct 2016 20:22:55 +0000 (-0400) Subject: JBAS-1437 Auth linker uses 'KCLS' control number identifer X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=ecd3433835495739c39cf5eea6cd2a24c61be8f7;p=working%2FEvergreen.git JBAS-1437 Auth linker uses 'KCLS' control number identifer Affects bib-to-auth and auth-to-auth linking. Signed-off-by: Bill Erickson --- diff --git a/KCLS/linking/authority_authority_linker.pl b/KCLS/linking/authority_authority_linker.pl index bf0f8ec524..2c134e74a4 100755 --- a/KCLS/linking/authority_authority_linker.pl +++ b/KCLS/linking/authority_authority_linker.pl @@ -54,6 +54,7 @@ my $db_user = $ENV{PGDATABASE} || 'evergreen'; my $db_pass = $ENV{PGPASSWORD}; my $links_removed = 0; my $links_added = 0; +my $CNI = 'KCLS'; my %options; my $result = GetOptions( @@ -209,7 +210,6 @@ while (my ($src, $links) = $sth->fetchrow_array) { next; } - my $cni = $target_marc->field('003')->data; my $acsaf = get_acsaf($e, $field_id); if (!$acsaf) { warn "No authority control set field found for $field_id. Skipping\n"; @@ -254,7 +254,7 @@ while (my ($src, $links) = $sth->fetchrow_array) { if ($target_string eq $src_string) { announce("Got a match"); - $field->update('0' => "($cni)$target"); + $field->update('0' => "($CNI)$target"); $changed = 1; $links_added++; } diff --git a/KCLS/linking/authority_control_fields.pl b/KCLS/linking/authority_control_fields.pl index c848f5ff0f..5390bb855c 100755 --- a/KCLS/linking/authority_control_fields.pl +++ b/KCLS/linking/authority_control_fields.pl @@ -49,6 +49,7 @@ my $db_host = $ENV{PGHOST} || 'localhost'; my $db_port = $ENV{PGPORT} || '5432'; my $db_user = $ENV{PGDATABASE} || 'evergreen'; my $db_pass = $ENV{PGPASSWORD}; +my $CNI = 'KCLS'; my %options; my $result = GetOptions( @@ -822,19 +823,9 @@ foreach my $rec_id (@records) { if ($auth_id) { # Add the auth ID and control number agency info from the # matching authority record to the controlled bib field. - - my $auth_003 = $e->json_query({ - select => {afr => ['value']}, - from => 'afr', - where => {'+afr' => - {tag => '003', record => $auth_id}} - })->[0]; - - my $cni = $auth_003->{value} || ''; - $bib_field->add_subfields('0' => "($cni)$auth_id"); $changed = 1; - - announce("auth=$auth_id cni=$cni. It's a match!"); + $bib_field->add_subfields('0' => "($CNI)$auth_id"); + announce("auth=$auth_id cni=$CNI. It's a match!"); } } }