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

(-)a/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc (-12 / +14 lines)
Lines 1-19 Link Here
1
[% IF ( PAGE_NUMBERS ) %]
1
[% IF ( PAGE_NUMBERS ) %]
2
    <div class="pagination pagination-small noprint">
2
    <div class="pagination pagination-small noprint">
3
        <ul>
3
        <ul>
4
        [% IF ( previous_page_offset.defined ) %]
4
            <li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html %][% END %]">First</a></li>
5
            <li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% previous_page_offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html %][% END %]">&laquo; Previous</a></li>
5
            [% IF ( previous_page_offset.defined ) %]
6
        [% END %]
6
                <li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% previous_page_offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html %][% END %]">&laquo; Previous</a></li>
7
        [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %]
8
            [% IF ( PAGE_NUMBER.highlight ) %]
9
                <li class="active"><a href="#">[% PAGE_NUMBER.pg %]</a></li>
10
            [% ELSE %]
11
                <li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% PAGE_NUMBER.offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html%][% END %]">[% PAGE_NUMBER.pg %]</a></li>
12
            [% END %]
7
            [% END %]
13
        [% END %]
8
            [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %]
14
        [% IF ( next_page_offset ) %]
9
                [% IF ( PAGE_NUMBER.highlight ) %]
15
            <li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% next_page_offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html %][% END %]">Next &raquo;</a></li>
10
                    <li class="active"><a href="#">[% PAGE_NUMBER.pg %]</a></li>
16
        [% END %]
11
                [% ELSE %]
12
                    <li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% PAGE_NUMBER.offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html%][% END %]">[% PAGE_NUMBER.pg %]</a></li>
13
                [% END %]
14
            [% END %]
15
            [% IF ( next_page_offset ) %]
16
                <li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% next_page_offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html %][% END %]">Next &raquo;</a></li>
17
            [% END %]
18
            <li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% last_page %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |html %][% END %]">Last</a></li>
17
        </ul>
19
        </ul>
18
    </div>
20
    </div>
19
[% END %]
21
[% END %]
(-)a/opac/opac-search.pl (-1 / +2 lines)
Lines 838-843 for (my $i=0;$i<@servers;$i++) { Link Here
838
            my @page_numbers;
838
            my @page_numbers;
839
            # total number of pages there will be
839
            # total number of pages there will be
840
            my $pages = ceil($hits / $results_per_page);
840
            my $pages = ceil($hits / $results_per_page);
841
            my $last_page = ($pages * $results_per_page) - $results_per_page;
841
            # default page number
842
            # default page number
842
            my $current_page_number = 1;
843
            my $current_page_number = 1;
843
            if ($offset) {
844
            if ($offset) {
Lines 888-893 for (my $i=0;$i<@servers;$i++) { Link Here
888
                        
889
                        
889
            }
890
            }
890
            $template->param(   PAGE_NUMBERS => \@page_numbers,
891
            $template->param(   PAGE_NUMBERS => \@page_numbers,
892
                                last_page => $last_page,
891
                                previous_page_offset => $previous_page_offset) unless $pages < 2;
893
                                previous_page_offset => $previous_page_offset) unless $pages < 2;
892
            $template->param(next_page_offset => $next_page_offset) unless $pages eq $current_page_number;
894
            $template->param(next_page_offset => $next_page_offset) unless $pages eq $current_page_number;
893
        }
895
        }
894
- 

Return to bug 13205