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

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

Return to bug 33406