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

(-)a/Koha/SearchEngine/Elasticsearch/Search.pm (-1 / +3 lines)
Lines 187-193 results in a form the same as L<C4::AuthoritiesMarc::SearchAuthorities>. Link Here
187
sub search_auth_compat {
187
sub search_auth_compat {
188
    my $self = shift;
188
    my $self = shift;
189
189
190
    # TODO handle paging
190
    # FIXME the options here should match zebra - we take page, but should take offset
191
    # page is calculated to offset in search above, though we can pass offset directly too
192
    # via options
191
    my $database = Koha::Database->new();
193
    my $database = Koha::Database->new();
192
    my $schema   = $database->schema();
194
    my $schema   = $database->schema();
193
    my $res      = $self->search(@_);
195
    my $res      = $self->search(@_);
(-)a/authorities/authorities-home.pl (-7 / +11 lines)
Lines 23-28 use warnings; Link Here
23
use CGI qw ( -utf8 );
23
use CGI qw ( -utf8 );
24
use URI::Escape;
24
use URI::Escape;
25
use C4::Auth;
25
use C4::Auth;
26
use POSIX qw(ceil);
26
27
27
use C4::Context;
28
use C4::Context;
28
use C4::Auth;
29
use C4::Auth;
Lines 95-102 if ( $op eq "do_search" ) { Link Here
95
        [$marclist], [$and_or], [$excluding], [$operator],
96
        [$marclist], [$and_or], [$excluding], [$operator],
96
        [$value], $authtypecode, $orderby
97
        [$value], $authtypecode, $orderby
97
    );
98
    );
99
    my $offset = ( $startfrom - 1 ) * $resultsperpage + 1;
98
    my ( $results, $total ) = $searcher->search_auth_compat(
100
    my ( $results, $total ) = $searcher->search_auth_compat(
99
        $search_query, $startfrom, $resultsperpage
101
        $search_query, $offset, $resultsperpage, ( offset => $offset - 1 )
100
    );
102
    );
101
103
102
    ( $template, $loggedinuser, $cookie ) = get_template_and_user(
104
    ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Lines 180-194 if ( $op eq "do_search" ) { Link Here
180
182
181
    $template->param( result => $results ) if $results;
183
    $template->param( result => $results ) if $results;
182
184
185
    my $max_result_window = $searcher->max_result_window;
186
    my $hits_to_paginate = ($max_result_window && $max_result_window < $total) ? $max_result_window : $total;
183
    $template->param(
187
    $template->param(
184
        pagination_bar => pagination_bar(
188
        pagination_bar => pagination_bar(
185
            $base_url,  int( $total / $resultsperpage ) + 1,
189
            $base_url,  ceil( $hits_to_paginate / $resultsperpage ) ,
186
            $startfrom, 'startfrom'
190
            $startfrom, 'startfrom'
187
        ),
191
        ),
188
        total     => $total,
192
        total            => $total,
189
        from      => $from,
193
        hits_to_paginate => $hits_to_paginate,
190
        to        => $to,
194
        from             => $from,
191
        isEDITORS => $authtypecode eq 'EDITORS',
195
        to               => $to,
196
        isEDITORS        => $authtypecode eq 'EDITORS',
192
    );
197
    );
193
198
194
}
199
}
195
- 

Return to bug 21405