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

(-)a/C4/Heading.pm (-11 / +11 lines)
Lines 149-158 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
    my ( $results, $total ) = _search( $self, 'match-heading', $skipmetadata, $checkvalidity );
155
    my ( $results, $total ) =
156
      _search( $self, 'match-heading', $skipmetadata, $checkvalidity );
156
    return $results;
157
    return $results;
157
}
158
}
158
159
Lines 179-187 sub preferred_authorities { Link Here
179
=cut
180
=cut
180
181
181
sub _search {
182
sub _search {
182
    my $self         = shift;
183
    my $self          = shift;
183
    my $index        = shift || undef;
184
    my $index         = shift || undef;
184
    my $skipmetadata = shift || undef;
185
    my $skipmetadata  = shift || undef;
185
    my $checkvalidity = shift || undef;
186
    my $checkvalidity = shift || undef;
186
    my @marclist;
187
    my @marclist;
187
    my @and_or;
188
    my @and_or;
Lines 205-219 sub _search { Link Here
205
    #    }
206
    #    }
206
    require C4::AuthoritiesMarc;
207
    require C4::AuthoritiesMarc;
207
    my ( $authorities, $nbresults ) = C4::AuthoritiesMarc::SearchAuthorities(
208
    my ( $authorities, $nbresults ) = C4::AuthoritiesMarc::SearchAuthorities(
208
        \@marclist, \@and_or, \@excluding, \@operator,
209
        \@marclist,  \@and_or, \@excluding, \@operator,
209
        \@value,    0,        20,          $self->{'auth_type'},
210
        \@value,     0,        20,          $self->{'auth_type'},
210
        'AuthidAsc',         $skipmetadata
211
        'AuthidAsc', $skipmetadata
211
    );
212
    );
212
213
213
    if ($checkvalidity) {
214
    if ($checkvalidity) {
214
        my @authorities_cheked;
215
        my @authorities_cheked;
215
        foreach (@$authorities) {
216
        foreach (@$authorities) {
216
            # TODO should be merged with C4::Biblio->_check_valid_auth_link
217
                # TODO should be merged with C4::Biblio->_check_valid_auth_link
217
            my $authorized_heading = C4::AuthoritiesMarc::GetAuthorizedHeading(
218
            my $authorized_heading = C4::AuthoritiesMarc::GetAuthorizedHeading(
218
                { authid => $_->{'authid'} } );
219
                { authid => $_->{'authid'} } );
219
            my $field_value =
220
            my $field_value =
220
- 

Return to bug 9072