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

(-)a/authorities/authorities-home.pl (-12 / +21 lines)
Lines 85-102 if ( $op eq "do_search" ) { Link Here
85
    my $resultsperpage = $query->param('resultsperpage') || 20;
85
    my $resultsperpage = $query->param('resultsperpage') || 20;
86
    my $offset = ( $startfrom - 1 ) * $resultsperpage + 1;
86
    my $offset = ( $startfrom - 1 ) * $resultsperpage + 1;
87
87
88
    my $builder = Koha::SearchEngine::QueryBuilder->new(
89
        { index => $Koha::SearchEngine::AUTHORITIES_INDEX } );
90
    my $searcher = Koha::SearchEngine::Search->new(
91
        { index => $Koha::SearchEngine::AUTHORITIES_INDEX } );
92
    my $search_query = $builder->build_authorities_query_compat(
93
        [$marclist], [$and_or], [$excluding], [$operator],
94
        [$value], $authtypecode, $orderby
95
    );
96
    my ( $results, $total ) = $searcher->search_auth_compat(
97
        $search_query, $offset, $resultsperpage
98
    );
99
100
    ( $template, $loggedinuser, $cookie ) = get_template_and_user(
88
    ( $template, $loggedinuser, $cookie ) = get_template_and_user(
101
        {
89
        {
102
            template_name   => "authorities/searchresultlist.tt",
90
            template_name   => "authorities/searchresultlist.tt",
Lines 106-111 if ( $op eq "do_search" ) { Link Here
106
        }
94
        }
107
    );
95
    );
108
96
97
    my $builder = Koha::SearchEngine::QueryBuilder->new(
98
        { index => $Koha::SearchEngine::AUTHORITIES_INDEX } );
99
    my $searcher = Koha::SearchEngine::Search->new(
100
        { index => $Koha::SearchEngine::AUTHORITIES_INDEX } );
101
102
    my $search_query = $builder->build_authorities_query_compat(
103
        [$marclist], [$and_or], [$excluding], [$operator],
104
        [$value], $authtypecode, $orderby
105
    );
106
    my ( $results, $total );
107
    eval {
108
        ( $results, $total ) = $searcher->search_auth_compat(
109
            $search_query, $offset, $resultsperpage
110
        );
111
    };
112
    if ($@) {
113
        my $query_error = q{};
114
        $query_error .= $@ if $@;
115
        $template->param(query_error => $query_error);
116
    }
117
109
    $template->param( search_query => $search_query ) if C4::Context->preference('DumpSearchQueryTemplate');
118
    $template->param( search_query => $search_query ) if C4::Context->preference('DumpSearchQueryTemplate');
110
    $template->param(
119
    $template->param(
111
        csrf_token => Koha::Token->new->generate_csrf({
120
        csrf_token => Koha::Token->new->generate_csrf({
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt (-1 / +4 lines)
Lines 43-48 Link Here
43
43
44
<div id="merge_in_progress" class="page-section bg-info" style="display:none;"></div>
44
<div id="merge_in_progress" class="page-section bg-info" style="display:none;"></div>
45
<div class="page-section">
45
<div class="page-section">
46
    [% IF ( query_error ) %]
47
        <div class="dialog alert"><p><strong>Error:</strong> [% query_error | html %]</p></div>
48
    [% END %]
49
46
    [% IF ( total ) %]
50
    [% IF ( total ) %]
47
    <div class="pages">[% pagination_bar | $raw %]</div>
51
    <div class="pages">[% pagination_bar | $raw %]</div>
48
52
49
- 

Return to bug 33406