|
Lines 148-154
sub authorities {
Link Here
|
| 148 |
my $self = shift; |
148 |
my $self = shift; |
| 149 |
my $skipmetadata = shift; |
149 |
my $skipmetadata = shift; |
| 150 |
my ( $results, $total ) = _search( $self, 'match-heading', $skipmetadata ); |
150 |
my ( $results, $total ) = _search( $self, 'match-heading', $skipmetadata ); |
| 151 |
return $results; |
151 |
if ( C4::Context->preference('LinkerConsiderDiacritics') ) { |
|
|
152 |
return $self->_filter_diacritics($results); |
| 153 |
} else { |
| 154 |
return $results; |
| 155 |
} |
| 152 |
} |
156 |
} |
| 153 |
|
157 |
|
| 154 |
=head2 valid_heading_subfield |
158 |
=head2 valid_heading_subfield |
|
Lines 249-254
sub _search {
Link Here
|
| 249 |
|
253 |
|
| 250 |
} |
254 |
} |
| 251 |
|
255 |
|
|
|
256 |
=head2 _filter_diacritics |
| 257 |
|
| 258 |
=cut |
| 259 |
|
| 260 |
sub _filter_diacritics { |
| 261 |
my $self = shift; |
| 262 |
my $results = shift; |
| 263 |
my $exact_matched_auths = []; |
| 264 |
for my $matched_auth (@$results) { |
| 265 |
my $auth = Koha::Authorities->find( $matched_auth->{authid} ); |
| 266 |
next unless $auth; |
| 267 |
my $authrec = $auth->record; |
| 268 |
my $auth_tag_to_report = Koha::Authority::Types->find( $self->{auth_type} )->auth_tag_to_report; |
| 269 |
my $auth_heading_field = $authrec->field($auth_tag_to_report); |
| 270 |
$auth_heading_field->set_tag( $self->field->tag ); |
| 271 |
my $auth_heading = C4::Heading->new_from_field($auth_heading_field); |
| 272 |
if ( $auth_heading->search_form eq $self->search_form ) { |
| 273 |
push @$exact_matched_auths, $matched_auth; |
| 274 |
} |
| 275 |
} |
| 276 |
return $exact_matched_auths; |
| 277 |
} |
| 278 |
|
| 252 |
=head1 INTERNAL FUNCTIONS |
279 |
=head1 INTERNAL FUNCTIONS |
| 253 |
|
280 |
|
| 254 |
=head2 _marc_format_handler |
281 |
=head2 _marc_format_handler |
| 255 |
- |
|
|