View | Details | Raw Unified | Return to bug 9072
Collapse All | Expand All

(-)a/C4/Heading.pm (-13 / +12 lines)
Lines 149-156 If passed a true value for $checkvalidity, SearchAuthorities will check authorit Link Here
149
=cut
149
=cut
150
150
151
sub authorities {
151
sub authorities {
152
    my $self         = shift;
152
    my $self          = shift;
153
    my $skipmetadata = shift;
153
    my $skipmetadata  = shift;
154
    my $checkvalidity = shift;
154
    my $checkvalidity = shift;
155
    return $self->_search( 'match-heading', $skipmetadata, $checkvalidity );
155
    return $self->_search( 'match-heading', $skipmetadata, $checkvalidity );
156
}
156
}
Lines 166-173 If passed a true value for $checkvalidity, SearchAuthorities will check authorit Link Here
166
=cut
166
=cut
167
167
168
sub preferred_authorities {
168
sub preferred_authorities {
169
    my $self = shift;
169
    my $self          = shift;
170
    my $skipmetadata = shift;
170
    my $skipmetadata  = shift;
171
    my $checkvalidity = shift;
171
    my $checkvalidity = shift;
172
    return $self->_search( 'see-from', $skipmetadata, $checkvalidity );
172
    return $self->_search( 'see-from', $skipmetadata, $checkvalidity );
173
}
173
}
Lines 182-188 Check whether the link with specified auth is valid. Link Here
182
182
183
sub check_valid_auth_link {
183
sub check_valid_auth_link {
184
    #TODO should be merged with C4::Biblio->_check_valid_auth_link
184
    #TODO should be merged with C4::Biblio->_check_valid_auth_link
185
    my $self = shift;
185
    my $self   = shift;
186
    my $authid = shift;
186
    my $authid = shift;
187
187
188
    my $field_value = $self->{'field'}->as_string('abcdefghijklmnopqrstuvwxyz');
188
    my $field_value = $self->{'field'}->as_string('abcdefghijklmnopqrstuvwxyz');
Lines 193-199 sub check_valid_auth_link { Link Here
193
      C4::AuthoritiesMarc::GetAuthorizedHeading( { 'authid' => $authid } );
193
      C4::AuthoritiesMarc::GetAuthorizedHeading( { 'authid' => $authid } );
194
    return unless $authorized_heading;
194
    return unless $authorized_heading;
195
195
196
    return ($field_value eq $authorized_heading);
196
    return ( $field_value eq $authorized_heading );
197
}
197
}
198
198
199
=head1 INTERNAL METHODS
199
=head1 INTERNAL METHODS
Lines 203-211 sub check_valid_auth_link { Link Here
203
=cut
203
=cut
204
204
205
sub _search {
205
sub _search {
206
    my $self         = shift;
206
    my $self          = shift;
207
    my $index        = shift || undef;
207
    my $index         = shift || undef;
208
    my $skipmetadata = shift || undef;
208
    my $skipmetadata  = shift || undef;
209
    my $checkvalidity = shift || undef;
209
    my $checkvalidity = shift || undef;
210
    my @marclist;
210
    my @marclist;
211
    my @and_or;
211
    my @and_or;
Lines 229-237 sub _search { Link Here
229
    #    }
229
    #    }
230
    require C4::AuthoritiesMarc;
230
    require C4::AuthoritiesMarc;
231
    my ( $authorities, $nbresults ) = C4::AuthoritiesMarc::SearchAuthorities(
231
    my ( $authorities, $nbresults ) = C4::AuthoritiesMarc::SearchAuthorities(
232
        \@marclist, \@and_or, \@excluding, \@operator,
232
        \@marclist,  \@and_or, \@excluding, \@operator,
233
        \@value,    0,        10000,          $self->{'auth_type'},
233
        \@value,     0,        10000,       $self->{'auth_type'},
234
        'AuthidAsc',         $skipmetadata
234
        'AuthidAsc', $skipmetadata
235
    );
235
    );
236
236
237
    if ($checkvalidity) {
237
    if ($checkvalidity) {
238
- 

Return to bug 9072