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

(-)a/catalogue/search.pl (+1 lines)
Lines 628-633 for (my $i=0;$i<@servers;$i++) { Link Here
628
            $template->param(limit_cgi_not_only_host_items=> $limit_cgi_not_only_host_items);
628
            $template->param(limit_cgi_not_only_host_items=> $limit_cgi_not_only_host_items);
629
            $template->param(limit_cgi => $limit_cgi);
629
            $template->param(limit_cgi => $limit_cgi);
630
            $template->param(query_cgi => $query_cgi);
630
            $template->param(query_cgi => $query_cgi);
631
            $template->param(full_query => $ENV{QUERY_STRING});
631
            $template->param(query_desc => $query_desc);
632
            $template->param(query_desc => $query_desc);
632
            $template->param(limit_desc => $limit_desc);
633
            $template->param(limit_desc => $limit_desc);
633
            $template->param(offset     => $offset);
634
            $template->param(offset     => $offset);
(-)a/koha-tmpl/intranet-tmpl/js/browser.js (-4 / +5 lines)
Lines 30-44 KOHA.browser = function (searchid, biblionumber) { Link Here
30
    var browseRecords = function (movement) {
30
    var browseRecords = function (movement) {
31
        var newSearchPos = me.curPos + movement;
31
        var newSearchPos = me.curPos + movement;
32
        if (newSearchPos > current_search.results.length - 1) {
32
        if (newSearchPos > current_search.results.length - 1) {
33
            window.location = '/cgi-bin/koha/catalogue/search.pl?' + decodeURIComponent(current_search.query) + '&limit=' + decodeURIComponent(current_search.limit) + '&sort=' + current_search.sort + '&gotoPage=detail.pl&gotoNumber=first&searchid=' + me.searchid + '&offset=' + newSearchPos;
33
            window.location = '/cgi-bin/koha/catalogue/search.pl?' + decodeURIComponent(current_search.full_query.replace(/&offset(=[^&]*)?|^offset(=[^&]*)?&?/g, '')) + '&gotoPage=detail.pl&gotoNumber=first&searchid=' + me.searchid + '&offset=' + newSearchPos;
34
        } else if (newSearchPos < 0) {
34
        } else if (newSearchPos < 0) {
35
            window.location = '/cgi-bin/koha/catalogue/search.pl?' + decodeURIComponent(current_search.query) + '&limit=' + decodeURIComponent(current_search.limit) + '&sort=' + current_search.sort + '&gotoPage=detail.pl&gotoNumber=last&searchid=' + me.searchid + '&offset=' + (me.offset - current_search.pagelen);
35
            window.location = '/cgi-bin/koha/catalogue/search.pl?' + decodeURIComponent(current_search.full_query.replace(/&offset(=[^&]*)?|^offset(=[^&]*)?&?/g, '')) + '&gotoPage=detail.pl&gotoNumber=last&searchid=' + me.searchid + '&offset=' + (me.offset - current_search.pagelen);
36
        } else {
36
        } else {
37
            window.location = window.location.href.replace('biblionumber=' + biblionumber, 'biblionumber=' + current_search.results[newSearchPos]);
37
            window.location = window.location.href.replace('biblionumber=' + biblionumber, 'biblionumber=' + current_search.results[newSearchPos]);
38
        }
38
        }
39
    }
39
    }
40
40
41
    me.create = function (offset, query, limit, sort, newresults, total) {
41
    me.create = function (offset, query, limit, sort, newresults, total, full_query) {
42
        if (current_search) {
42
        if (current_search) {
43
            if (offset === current_search.offset - newresults.length) {
43
            if (offset === current_search.offset - newresults.length) {
44
                current_search.results = newresults.concat(current_search.results);
44
                current_search.results = newresults.concat(current_search.results);
Lines 51-56 KOHA.browser = function (searchid, biblionumber) { Link Here
51
        if (!current_search) {
51
        if (!current_search) {
52
            current_search = { offset: offset,
52
            current_search = { offset: offset,
53
                query: query,
53
                query: query,
54
                full_query: full_query,
54
                limit: limit,
55
                limit: limit,
55
                sort:  sort,
56
                sort:  sort,
56
                pagelen: newresults.length,
57
                pagelen: newresults.length,
Lines 89-95 KOHA.browser = function (searchid, biblionumber) { Link Here
89
90
90
            $(document).ready(function () {
91
            $(document).ready(function () {
91
                if (me.curPos > -1) {
92
                if (me.curPos > -1) {
92
                    var searchURL = '/cgi-bin/koha/catalogue/search.pl?' + decodeURIComponent(current_search.query) + '&limit=' + decodeURIComponent(current_search.limit) + '&sort=' + current_search.sort + '&searchid=' + me.searchid + '&offset=' + me.offset;
93
                    var searchURL = '/cgi-bin/koha/catalogue/search.pl?' + decodeURIComponent(current_search.full_query.replace(/&offset(=[^&]*)?|^offset(=[^&]*)?&?/g, '')) + '&offset=' + me.offset;
93
                    var prevbutton;
94
                    var prevbutton;
94
                    var nextbutton;
95
                    var nextbutton;
95
                    if (me.curPos === 0 && current_search.offset === 1) {
96
                    if (me.curPos === 0 && current_search.offset === 1) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc (-5 / +5 lines)
Lines 1-19 Link Here
1
[% IF ( PAGE_NUMBERS ) %]<nav><ul class="pagination">
1
[% IF ( PAGE_NUMBERS ) %]<nav><ul class="pagination">
2
 [% IF hits_to_paginate < total %]<h6>[% hits_to_paginate %] of [% total %] results loaded, refine your search to view other records</h6>[% END %]
2
 [% IF hits_to_paginate < total %]<h6>[% hits_to_paginate %] of [% total %] results loaded, refine your search to view other records</h6>[% END %]
3
    [% IF ( previous_page_offset.defined ) %]
3
    [% IF ( previous_page_offset.defined ) %]
4
        <li><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |url %][% END %]">First</a></li>
4
        <li><a href="/cgi-bin/koha/catalogue/search.pl?[% full_query |replace('&offset(=[^&]*)?|^offset(=[^&]*)?&?', '') |html %]">First</a></li>
5
        <!-- Row of numbers corresponding to search result pages -->
5
        <!-- Row of numbers corresponding to search result pages -->
6
        <li><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% previous_page_offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |url %][% END %]">&lt;&lt; Previous</a></li>
6
        <li><a href="/cgi-bin/koha/catalogue/search.pl?[% full_query |replace('&offset(=[^&]*)?|^offset(=[^&]*)?&?', '') |html %]&amp;offset=[% previous_page_offset %]">&lt;&lt; Previous</a></li>
7
    [% END %]
7
    [% END %]
8
    [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %]
8
    [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %]
9
        [% IF ( PAGE_NUMBER.highlight ) %]
9
        [% IF ( PAGE_NUMBER.highlight ) %]
10
            <li class="active"><span>[% PAGE_NUMBER.pg %]</span></li>
10
            <li class="active"><span>[% PAGE_NUMBER.pg %]</span></li>
11
        [% ELSE %]
11
        [% ELSE %]
12
            <li><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% PAGE_NUMBER.offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |url %][% END %]">[% PAGE_NUMBER.pg %]</a></li>
12
            <li><a href="/cgi-bin/koha/catalogue/search.pl?[% full_query |replace('&offset(=[^&]*)?|^offset(=[^&]*)?&?', '') |html %]&amp;offset=[% PAGE_NUMBER.offset %]">[% PAGE_NUMBER.pg %]</a></li>
13
        [% END %]
13
        [% END %]
14
    [% END %]
14
    [% END %]
15
    [% IF ( next_page_offset ) %]
15
    [% IF ( next_page_offset ) %]
16
        <li><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% next_page_offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |url %][% END %]">Next &gt;&gt;</a></li>
16
        <li><a href="/cgi-bin/koha/catalogue/search.pl?[% full_query |replace('&offset(=[^&]*)?|^offset(=[^&]*)?&?', '') |html %]&amp;offset=[% next_page_offset %]">Next &gt;&gt;</a></li>
17
        <li><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %]&amp;offset=[% last_page_offset %][% IF ( sort_by ) %]&amp;sort_by=[% sort_by |url %][% END %]">Last</a></li>
17
        <li><a href="/cgi-bin/koha/catalogue/search.pl?[% full_query |replace('&offset(=[^&]*)?|^offset(=[^&]*)?&?', '') |html %]&amp;offset=[% last_page_offset %]">Last</a></li>
18
    [% END %]
18
    [% END %]
19
</ul></nav>[% END %]
19
</ul></nav>[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt (-2 / +1 lines)
Lines 176-182 $('#sort_by').change(function() { Link Here
176
        ];
176
        ];
177
        var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10));
177
        var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10));
178
        browser.create([% SEARCH_RESULTS.first.result_number %], '[% query_cgi %]', '[% limit_cgi | uri %]','[% sort_cgi | uri %]',
178
        browser.create([% SEARCH_RESULTS.first.result_number %], '[% query_cgi %]', '[% limit_cgi | uri %]','[% sort_cgi | uri %]',
179
               newresults, '[% total %]');
179
               newresults, '[% total %]', '[% full_query %]');
180
    [% END %]
180
    [% END %]
181
    [% IF (gotoPage && gotoNumber) %]
181
    [% IF (gotoPage && gotoNumber) %]
182
        [% IF (gotoNumber == 'first') %]
182
        [% IF (gotoNumber == 'first') %]
183
- 

Return to bug 20114