Lines 291-301
sub SearchAuthorities {
Link Here
|
291 |
my %newline; |
291 |
my %newline; |
292 |
$newline{authid} = $authid; |
292 |
$newline{authid} = $authid; |
293 |
if ( !$skipmetadata ) { |
293 |
if ( !$skipmetadata ) { |
294 |
my $query_auth_tag = |
294 |
my $auth_tag_to_report = Koha::Authority::Types->find($authtypecode)->auth_tag_to_report; |
295 |
"SELECT auth_tag_to_report FROM auth_types WHERE authtypecode=?"; |
|
|
296 |
my $sth = $dbh->prepare($query_auth_tag); |
297 |
$sth->execute($authtypecode); |
298 |
my $auth_tag_to_report = $sth->fetchrow; |
299 |
my $reported_tag; |
295 |
my $reported_tag; |
300 |
my $mainentry = $authrecord->field($auth_tag_to_report); |
296 |
my $mainentry = $authrecord->field($auth_tag_to_report); |
301 |
if ($mainentry) { |
297 |
if ($mainentry) { |
Lines 848-857
sub FindDuplicateAuthority {
Link Here
|
848 |
# warn "IN for ".$record->as_formatted; |
844 |
# warn "IN for ".$record->as_formatted; |
849 |
my $dbh = C4::Context->dbh; |
845 |
my $dbh = C4::Context->dbh; |
850 |
# warn "".$record->as_formatted; |
846 |
# warn "".$record->as_formatted; |
851 |
my $sth = $dbh->prepare("select auth_tag_to_report from auth_types where authtypecode=?"); |
847 |
my $auth_tag_to_report = Koha::Authority::Types->find($authtypecode)->auth_tag_to_report; |
852 |
$sth->execute($authtypecode); |
|
|
853 |
my ($auth_tag_to_report) = $sth->fetchrow; |
854 |
$sth->finish; |
855 |
# warn "record :".$record->as_formatted." auth_tag_to_report :$auth_tag_to_report"; |
848 |
# warn "record :".$record->as_formatted." auth_tag_to_report :$auth_tag_to_report"; |
856 |
# build a request for SearchAuthorities |
849 |
# build a request for SearchAuthorities |
857 |
my $QParser; |
850 |
my $QParser; |
Lines 1456-1467
sub merge {
Link Here
|
1456 |
return "error MARCFROM not a marcrecord ".Data::Dumper::Dumper($MARCfrom) if scalar($MARCfrom->fields()) == 0; |
1449 |
return "error MARCFROM not a marcrecord ".Data::Dumper::Dumper($MARCfrom) if scalar($MARCfrom->fields()) == 0; |
1457 |
return "error MARCTO not a marcrecord".Data::Dumper::Dumper($MARCto) if scalar($MARCto->fields()) == 0; |
1450 |
return "error MARCTO not a marcrecord".Data::Dumper::Dumper($MARCto) if scalar($MARCto->fields()) == 0; |
1458 |
# search the tag to report |
1451 |
# search the tag to report |
1459 |
my $sth = $dbh->prepare("select auth_tag_to_report from auth_types where authtypecode=?"); |
1452 |
my $auth_tag_to_report_from = Koha::Authority::Types->find($authtypecodefrom)->auth_tag_to_report; |
1460 |
$sth->execute($authtypecodefrom); |
1453 |
my $auth_tag_to_report_to = Koha::Authority::Types->find($authtypecodeto)->auth_tag_to_report; |
1461 |
my ($auth_tag_to_report_from) = $sth->fetchrow; |
1454 |
|
1462 |
$sth->execute($authtypecodeto); |
|
|
1463 |
my ($auth_tag_to_report_to) = $sth->fetchrow; |
1464 |
|
1465 |
my @record_to; |
1455 |
my @record_to; |
1466 |
@record_to = $MARCto->field($auth_tag_to_report_to)->subfields() if $MARCto->field($auth_tag_to_report_to); |
1456 |
@record_to = $MARCto->field($auth_tag_to_report_to)->subfields() if $MARCto->field($auth_tag_to_report_to); |
1467 |
my @record_from; |
1457 |
my @record_from; |
Lines 1499-1505
sub merge {
Link Here
|
1499 |
#warn scalar(@reccache)." biblios to update"; |
1489 |
#warn scalar(@reccache)." biblios to update"; |
1500 |
# Get All candidate Tags for the change |
1490 |
# Get All candidate Tags for the change |
1501 |
# (This will reduce the search scope in marc records). |
1491 |
# (This will reduce the search scope in marc records). |
1502 |
$sth = $dbh->prepare("select distinct tagfield from marc_subfield_structure where authtypecode=?"); |
1492 |
my $sth = $dbh->prepare("select distinct tagfield from marc_subfield_structure where authtypecode=?"); |
1503 |
$sth->execute($authtypecodefrom); |
1493 |
$sth->execute($authtypecodefrom); |
1504 |
my @tags_using_authtype; |
1494 |
my @tags_using_authtype; |
1505 |
while (my ($tagfield) = $sth->fetchrow) { |
1495 |
while (my ($tagfield) = $sth->fetchrow) { |