|
Lines 266-275
sub SearchAuthorities {
Link Here
|
| 266 |
|
266 |
|
| 267 |
##Here we have to extract MARC record and $authid from ZEBRA AUTHORITIES |
267 |
##Here we have to extract MARC record and $authid from ZEBRA AUTHORITIES |
| 268 |
my $rec=$oAResult->record($counter); |
268 |
my $rec=$oAResult->record($counter); |
| 269 |
my $marcdata=$rec->raw(); |
|
|
| 270 |
my $authrecord; |
| 271 |
my $separator=C4::Context->preference('authoritysep'); |
269 |
my $separator=C4::Context->preference('authoritysep'); |
| 272 |
$authrecord = MARC::File::USMARC::decode($marcdata); |
270 |
my $authrecord = MARC::Record->new_from_xml( |
|
|
271 |
$rec->raw(), |
| 272 |
'UTF-8' |
| 273 |
); |
| 273 |
my $authid=$authrecord->field('001')->data(); |
274 |
my $authid=$authrecord->field('001')->data(); |
| 274 |
my %newline; |
275 |
my %newline; |
| 275 |
$newline{authid} = $authid; |
276 |
$newline{authid} = $authid; |
|
Lines 847-861
sub FindDuplicateAuthority {
Link Here
|
| 847 |
my $query='at:'.$authtypecode.' '; |
848 |
my $query='at:'.$authtypecode.' '; |
| 848 |
my $filtervalues=qr([\001-\040\!\'\"\`\#\$\%\&\*\+,\-\./:;<=>\?\@\(\)\{\[\]\}_\|\~]); |
849 |
my $filtervalues=qr([\001-\040\!\'\"\`\#\$\%\&\*\+,\-\./:;<=>\?\@\(\)\{\[\]\}_\|\~]); |
| 849 |
if ($record->field($auth_tag_to_report)) { |
850 |
if ($record->field($auth_tag_to_report)) { |
| 850 |
foreach ($record->field($auth_tag_to_report)->subfields()) { |
851 |
foreach ($record->field($auth_tag_to_report)->subfields()) { |
| 851 |
$_->[1]=~s/$filtervalues/ /g; $query.= " $op he:\"".$_->[1]."\"" if ($_->[0]=~/[A-z]/); |
852 |
$_->[1]=~s/$filtervalues/ /g; $query.= " $op he:\"".$_->[1]."\"" if ($_->[0]=~/[A-z]/); |
| 852 |
} |
853 |
} |
| 853 |
} |
854 |
} |
| 854 |
my ($error, $results, $total_hits) = C4::Search::SimpleSearch( $query, 0, 1, [ "authorityserver" ] ); |
855 |
my ($error, $results, $total_hits) = C4::Search::SimpleSearch( $query, 0, 1, [ "authorityserver" ] ); |
| 855 |
# there is at least 1 result => return the 1st one |
856 |
# there is at least 1 result => return the 1st one |
| 856 |
if (!defined $error && @{$results} ) { |
857 |
if (!defined $error && @{$results} ) { |
| 857 |
my $marcrecord = MARC::File::USMARC::decode($results->[0]); |
858 |
my $marcrecord = MARC::Record->new_from_xml( |
| 858 |
return $marcrecord->field('001')->data,BuildSummary($marcrecord,$marcrecord->field('001')->data,$authtypecode); |
859 |
$results->[0] |
|
|
860 |
); |
| 861 |
return $marcrecord->field('001')->data,BuildSummary($marcrecord,$marcrecord->field('001')->data,$authtypecode); |
| 859 |
} |
862 |
} |
| 860 |
# no result, returns nothing |
863 |
# no result, returns nothing |
| 861 |
return; |
864 |
return; |
|
Lines 1452-1464
sub merge {
Link Here
|
| 1452 |
} |
1455 |
} |
| 1453 |
my $z=0; |
1456 |
my $z=0; |
| 1454 |
while ( $z<$count ) { |
1457 |
while ( $z<$count ) { |
| 1455 |
my $rec; |
1458 |
my $marcrecordzebra= MARC::Record->new_from_xml( |
| 1456 |
$rec=$oResult->record($z); |
1459 |
$oResult->record($z)->raw(), |
| 1457 |
my $marcdata = $rec->raw(); |
1460 |
'UTF-8' |
| 1458 |
my $marcrecordzebra= MARC::Record->new_from_usmarc($marcdata); |
1461 |
); |
| 1459 |
my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' ); |
1462 |
my ( $biblionumbertagfield, $biblionumbertagsubfield ) = &GetMarcFromKohaField( "biblio.biblionumber", '' ); |
| 1460 |
my $i = ($biblionumbertagfield < 10) ? $marcrecordzebra->field($biblionumbertagfield)->data : $marcrecordzebra->subfield($biblionumbertagfield, $biblionumbertagsubfield); |
1463 |
my $i = ($biblionumbertagfield < 10) |
| 1461 |
my $marcrecorddb=GetMarcBiblio($i); |
1464 |
? $marcrecordzebra->field( $biblionumbertagfield )->data |
|
|
1465 |
: $marcrecordzebra->subfield( $biblionumbertagfield, $biblionumbertagsubfield ); |
| 1466 |
my $marcrecorddb = GetMarcBiblio($i); |
| 1462 |
push @reccache, $marcrecorddb; |
1467 |
push @reccache, $marcrecorddb; |
| 1463 |
$z++; |
1468 |
$z++; |
| 1464 |
} |
1469 |
} |
| 1465 |
- |
|
|