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

(-)a/C4/Heading.pm (-4 / +7 lines)
Lines 151-157 SearchAuthorities will return only authids. Link Here
151
sub authorities {
151
sub authorities {
152
    my $self         = shift;
152
    my $self         = shift;
153
    my $skipmetadata = shift;
153
    my $skipmetadata = shift;
154
    my ( $results, $total ) = _search( $self, 'match-heading', $skipmetadata );
154
    my $sortorder    = shift;
155
    my ( $results, $total ) = _search( $self, 'match-heading', $skipmetadata, $sortorder );
155
    return $results;
156
    return $results;
156
}
157
}
157
158
Lines 166-173 that are a preferred form of the heading. Link Here
166
167
167
sub preferred_authorities {
168
sub preferred_authorities {
168
    my $self = shift;
169
    my $self = shift;
169
    my $skipmetadata = shift || undef;
170
    my $skipmetadata = shift;
170
    my ( $results, $total ) = _search( 'see-from', $skipmetadata );
171
    my $sortorder = shift;
172
    my ( $results, $total ) = _search( 'see-from', $skipmetadata, $sortorder );
171
    return $results;
173
    return $results;
172
}
174
}
173
175
Lines 181-186 sub _search { Link Here
181
    my $self         = shift;
183
    my $self         = shift;
182
    my $index        = shift || undef;
184
    my $index        = shift || undef;
183
    my $skipmetadata = shift || undef;
185
    my $skipmetadata = shift || undef;
186
    my $sortorder    = shift || 'AuthidAsc';
184
    my @marclist;
187
    my @marclist;
185
    my @and_or;
188
    my @and_or;
186
    my @excluding = [];
189
    my @excluding = [];
Lines 205-211 sub _search { Link Here
205
    return C4::AuthoritiesMarc::SearchAuthorities(
208
    return C4::AuthoritiesMarc::SearchAuthorities(
206
        \@marclist, \@and_or, \@excluding, \@operator,
209
        \@marclist, \@and_or, \@excluding, \@operator,
207
        \@value,    0,        20,          $self->{'auth_type'},
210
        \@value,    0,        20,          $self->{'auth_type'},
208
        'AuthidAsc',         $skipmetadata
211
        $sortorder, $skipmetadata
209
    );
212
    );
210
}
213
}
211
214
(-)a/C4/Linker/Default.pm (-3 / +11 lines)
Lines 39-46 sub get_link { Link Here
39
    }
39
    }
40
    else {
40
    else {
41
41
42
        # look for matching authorities
42
        # results sort order (defined in LinkerOptions)
43
        my $authorities = $heading->authorities(1);    # $skipmetadata = true
43
        my $sortorder;
44
        foreach (qw( HeadingAsc HeadingDsc AuthidAsc AuthidDsc )) {
45
            if ( $self->{$_} ) {
46
                $sortorder = $_;
47
                last;
48
            }
49
        }
50
51
        # look for matching authorities ($skipmetadata = true)
52
        my $authorities = $heading->authorities( 1, $sortorder );
44
53
45
        if ( $behavior eq 'default' && $#{$authorities} == 0 ) {
54
        if ( $behavior eq 'default' && $#{$authorities} == 0 ) {
46
            $authid = $authorities->[0]->{'authid'};
55
            $authid = $authorities->[0]->{'authid'};
47
- 

Return to bug 9072