- my ($bib_result, $bib_match, $item_result);
-
- if ($overlay_status ne 'no_match') {
- $bib_match = GetBestRecordMatch($import_record_id);
- if ($overlay_action eq 'replace') {
- $bib_result = defined($bib_match) ? 'replace' : 'create_new';
- } elsif ($overlay_action eq 'create_new') {
- $bib_result = 'create_new';
- } elsif ($overlay_action eq 'ignore') {
- $bib_result = 'ignore';
- }
- $item_result = ($item_action eq 'always_add' or $item_action eq 'add_only_for_matches') ? 'create_new' : 'ignore';
- } else {
- $bib_result = $nomatch_action;
- $item_result = ($item_action eq 'always_add' or $item_action eq 'add_only_for_new') ? 'create_new' : 'ignore';
- }
+ if ($record_type eq 'biblio') {
+ my ($bib_result, $bib_match, $item_result);
+
+ if ($overlay_status ne 'no_match') {
+ $bib_match = GetBestRecordMatch($import_record_id);
+ if ($overlay_action eq 'replace') {
+ $bib_result = defined($bib_match) ? 'replace' : 'create_new';
+ } elsif ($overlay_action eq 'create_new') {
+ $bib_result = 'create_new';
+ } elsif ($overlay_action eq 'ignore') {
+ $bib_result = 'ignore';
+ }
+ $item_result = ($item_action eq 'always_add' or $item_action eq 'add_only_for_matches') ? 'create_new' : 'ignore';
+ } else {
+ $bib_result = $nomatch_action;
+ $item_result = ($item_action eq 'always_add' or $item_action eq 'add_only_for_new') ? 'create_new' : 'ignore';
+ }
+ return ($bib_result, $item_result, $bib_match);
+ } else { # must be auths
+ my ($auth_result, $auth_match);
+
+ if ($overlay_status ne 'no_match') {
+ $auth_match = GetBestRecordMatch($import_record_id);
+ if ($overlay_action eq 'replace') {
+ $auth_result = defined($auth_match) ? 'replace' : 'create_new';
+ } elsif ($overlay_action eq 'create_new') {
+ $auth_result = 'create_new';
+ } elsif ($overlay_action eq 'ignore') {
+ $auth_result = 'ignore';
+ }
+ } else {
+ $auth_result = $nomatch_action;
+ }
+
+ return ($auth_result, undef, $auth_match);