|
Lines 67-72
BEGIN {
Link Here
|
| 67 |
|
67 |
|
| 68 |
merge |
68 |
merge |
| 69 |
FindDuplicateAuthority |
69 |
FindDuplicateAuthority |
|
|
70 |
isAuthorityDuplicated |
| 70 |
|
71 |
|
| 71 |
GuessAuthTypeCode |
72 |
GuessAuthTypeCode |
| 72 |
GuessAuthId |
73 |
GuessAuthId |
|
Lines 1162-1167
sub CompareFieldWithAuthority {
Link Here
|
| 1162 |
return 0; |
1163 |
return 0; |
| 1163 |
} |
1164 |
} |
| 1164 |
|
1165 |
|
|
|
1166 |
=head2 isAuthorityDuplicated |
| 1167 |
|
| 1168 |
$match = &CompareFieldWithAuthority({ field => $field, authid => $authid }) |
| 1169 |
|
| 1170 |
Takes a MARC::Field from a bibliographic record and an authid, and returns true if they match. |
| 1171 |
|
| 1172 |
=cut |
| 1173 |
|
| 1174 |
sub isAuthorityDuplicated { |
| 1175 |
my ($record,$record2,$authtypecode)=@_; |
| 1176 |
return 0 unless ($record && $record2); |
| 1177 |
|
| 1178 |
my $auth_tag_to_report = Koha::Authority::Types->find($authtypecode)->auth_tag_to_report; |
| 1179 |
my $filtervalues=qr([\001-\040\Q!'"`#$%&*+,-./:;<=>?@(){[}_|~\E\]]); |
| 1180 |
my $duplicate = 1; |
| 1181 |
if ($record->field($auth_tag_to_report)) { |
| 1182 |
foreach ($record->field($auth_tag_to_report)->subfields()) { |
| 1183 |
$_->[1]=~s/$filtervalues/ /g; |
| 1184 |
if ($_->[0]=~/[A-z]/ ){ |
| 1185 |
if($record2->field($auth_tag_to_report)->subfield($_->[0]) ne $_->[1]){ |
| 1186 |
$duplicate = 0; |
| 1187 |
last; |
| 1188 |
} |
| 1189 |
} |
| 1190 |
} |
| 1191 |
} |
| 1192 |
return $duplicate; |
| 1193 |
} |
| 1194 |
|
| 1165 |
=head2 BuildAuthHierarchies |
1195 |
=head2 BuildAuthHierarchies |
| 1166 |
|
1196 |
|
| 1167 |
$text= &BuildAuthHierarchies( $authid, $force) |
1197 |
$text= &BuildAuthHierarchies( $authid, $force) |
|
Lines 1569-1575
sub merge {
Link Here
|
| 1569 |
} |
1599 |
} |
| 1570 |
} |
1600 |
} |
| 1571 |
next if !$update; |
1601 |
next if !$update; |
| 1572 |
ModBiblio($marcrecord, $biblionumber, GetFrameworkCode($biblionumber)); |
1602 |
my $option = {}; |
|
|
1603 |
#Check if the record is duplicate |
| 1604 |
my $authtypecode = ""; |
| 1605 |
$authtypecode = $authtypeto->authtypecode if($authtypeto); |
| 1606 |
if(isAuthorityDuplicated($MARCfrom, $MARCto,$authtypecode) ){ |
| 1607 |
$option = { disable_autolink => 1 }; |
| 1608 |
} |
| 1609 |
ModBiblio($marcrecord, $biblionumber, GetFrameworkCode($biblionumber),$option); |
| 1573 |
$counteditedbiblio++; |
1610 |
$counteditedbiblio++; |
| 1574 |
} |
1611 |
} |
| 1575 |
return $counteditedbiblio; |
1612 |
return $counteditedbiblio; |
| 1576 |
- |
|
|