Lines 57-74
sub get_link {
Link Here
|
57 |
# look for matching authorities |
57 |
# look for matching authorities |
58 |
my $authorities = $heading->authorities(1); # $skipmetadata = true |
58 |
my $authorities = $heading->authorities(1); # $skipmetadata = true |
59 |
|
59 |
|
60 |
if ( $behavior eq 'default' && $#{$authorities} == 0 ) { |
60 |
if ( $behavior eq 'default' && $#{$authorities} == 1 ) { |
61 |
$authid = $authorities->[0]->{'authid'}; |
61 |
$authid = $authorities->[0]->{'authid'}; |
62 |
} |
62 |
} |
63 |
elsif ( $behavior eq 'first' && $#{$authorities} >= 0 ) { |
63 |
elsif ( $#{$authorities} > 1 ) { |
64 |
$authid = $authorities->[0]->{'authid'}; |
64 |
if ($behavior eq 'first'){ |
65 |
$fuzzy = $#{$authorities} > 0; |
65 |
$authid = $authorities->[0]->{'authid'}; |
66 |
} |
66 |
$fuzzy = $#{$authorities} > 1; |
67 |
elsif ( $behavior eq 'last' && $#{$authorities} >= 0 ) { |
67 |
} |
68 |
$authid = $authorities->[ $#{$authorities} ]->{'authid'}; |
68 |
else { |
69 |
$fuzzy = $#{$authorities} > 0; |
69 |
$authid = $authorities->[ $#{$authorities} - 1 ]->{'authid'}; |
|
|
70 |
$fuzzy = $#{$authorities} > 1; |
71 |
} |
70 |
} |
72 |
} |
71 |
|
|
|
72 |
if ( !defined $authid && $self->{'broader_headings'} ) { |
73 |
if ( !defined $authid && $self->{'broader_headings'} ) { |
73 |
my $field = $heading->field(); |
74 |
my $field = $heading->field(); |
74 |
my @subfields = $field->subfields(); |
75 |
my @subfields = $field->subfields(); |
Lines 166-172
sub getZ3950Authority {
Link Here
|
166 |
else { |
167 |
else { |
167 |
return; |
168 |
return; |
168 |
} |
169 |
} |
169 |
my $query =qq(Personal-name,do-not-truncate,ext="$heading->{'search_form'}"); |
170 |
my $query =qq(Match-heading,do-not-truncate,ext="$heading->{'search_form'}"); |
170 |
my $zquery = eval{ new ZOOM::Query::CCL2RPN($query, $self->{'conn'}) }; |
171 |
my $zquery = eval{ new ZOOM::Query::CCL2RPN($query, $self->{'conn'}) }; |
171 |
if($@) { |
172 |
if($@) { |
172 |
warn $query . "\n" . $@; |
173 |
warn $query . "\n" . $@; |
173 |
- |
|
|