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

(-)a/authorities/auth_finder.pl (+19 lines)
Lines 68-73 if ( $op eq "do_search" ) { Link Here
68
    my $startfrom      = $query->param('startfrom')      || 0;
68
    my $startfrom      = $query->param('startfrom')      || 0;
69
    my $resultsperpage = $query->param('resultsperpage') || 20;
69
    my $resultsperpage = $query->param('resultsperpage') || 20;
70
70
71
    if ( C4::Context->preference('ConsiderHeadingUse') ) {
72
        my $marcflavour = C4::Context->preference('marcflavour');
73
        my $biblio_tag  = substr( $index, 4, 3 );
74
        if ( $marcflavour eq 'MARC21' ) {
75
            my $heading_use_search_field =
76
                  $biblio_tag =~ /^[127]/ ? 'Heading-use-main-or-added-entry'
77
                : $biblio_tag =~ /^6/     ? 'Heading-use-subject-added-entry'
78
                : $biblio_tag =~ /^[48]/  ? 'Heading-use-series-added-entry'
79
                :                           undef;
80
            if ($heading_use_search_field) {
81
                push @marclist,  $heading_use_search_field;
82
                push @and_or,    'and';
83
                push @excluding, '';
84
                push @operator,  'is';
85
                push @value,     'a';
86
            }
87
        }
88
    }
89
71
    my $builder = Koha::SearchEngine::QueryBuilder->new(
90
    my $builder = Koha::SearchEngine::QueryBuilder->new(
72
        { index => $Koha::SearchEngine::AUTHORITIES_INDEX } );
91
        { index => $Koha::SearchEngine::AUTHORITIES_INDEX } );
73
    my $searcher = Koha::SearchEngine::Search->new(
92
    my $searcher = Koha::SearchEngine::Search->new(
(-)a/installer/data/mysql/atomicupdate/bug_38494-ConsiderHeadingUse_syspref.pl (-2 / +1 lines)
Lines 9-15 return { Link Here
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
10
11
        $dbh->do(
11
        $dbh->do(
12
q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('ConsiderHeadingUse', '0', NULL, 'Consider authority heading use (main/added entry, or subject, or series title) in cataloging and linking', 'YesNo')}
12
            q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('ConsiderHeadingUse', '0', NULL, 'Consider authority heading use (main/added entry, or subject, or series title) in cataloging and linking', 'YesNo')}
13
        );
13
        );
14
14
15
        say_success( $out, "Added system preference 'ConsiderHeadingUse'" );
15
        say_success( $out, "Added system preference 'ConsiderHeadingUse'" );
16
- 

Return to bug 38494