@@ -, +, @@ them --- catalogue/search.pl | 1 + koha-tmpl/intranet-tmpl/js/browser.js | 9 +++++---- .../intranet-tmpl/prog/en/includes/page-numbers.inc | 10 +++++----- .../intranet-tmpl/prog/en/modules/catalogue/results.tt | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) --- a/catalogue/search.pl +++ a/catalogue/search.pl @@ -628,6 +628,7 @@ for (my $i=0;$i<@servers;$i++) { $template->param(limit_cgi_not_only_host_items=> $limit_cgi_not_only_host_items); $template->param(limit_cgi => $limit_cgi); $template->param(query_cgi => $query_cgi); + $template->param(full_query => $ENV{QUERY_STRING}); $template->param(query_desc => $query_desc); $template->param(limit_desc => $limit_desc); $template->param(offset => $offset); --- a/koha-tmpl/intranet-tmpl/js/browser.js +++ a/koha-tmpl/intranet-tmpl/js/browser.js @@ -30,15 +30,15 @@ KOHA.browser = function (searchid, biblionumber) { var browseRecords = function (movement) { var newSearchPos = me.curPos + movement; if (newSearchPos > current_search.results.length - 1) { - 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; + 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; } else if (newSearchPos < 0) { - 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); + 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); } else { window.location = window.location.href.replace('biblionumber=' + biblionumber, 'biblionumber=' + current_search.results[newSearchPos]); } } - me.create = function (offset, query, limit, sort, newresults, total) { + me.create = function (offset, query, limit, sort, newresults, total, full_query) { if (current_search) { if (offset === current_search.offset - newresults.length) { current_search.results = newresults.concat(current_search.results); @@ -51,6 +51,7 @@ KOHA.browser = function (searchid, biblionumber) { if (!current_search) { current_search = { offset: offset, query: query, + full_query: full_query, limit: limit, sort: sort, pagelen: newresults.length, @@ -89,7 +90,7 @@ KOHA.browser = function (searchid, biblionumber) { $(document).ready(function () { if (me.curPos > -1) { - 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; + var searchURL = '/cgi-bin/koha/catalogue/search.pl?' + decodeURIComponent(current_search.full_query.replace(/&offset(=[^&]*)?|^offset(=[^&]*)?&?/g, '')) + '&offset=' + me.offset; var prevbutton; var nextbutton; if (me.curPos === 0 && current_search.offset === 1) { --- a/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc @@ -1,19 +1,19 @@ [% IF ( PAGE_NUMBERS ) %][% END %] --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -176,7 +176,7 @@ $('#sort_by').change(function() { ]; var browser = KOHA.browser('[% searchid %]', parseInt('[% biblionumber %]', 10)); browser.create([% SEARCH_RESULTS.first.result_number %], '[% query_cgi %]', '[% limit_cgi | uri %]','[% sort_cgi | uri %]', - newresults, '[% total %]'); + newresults, '[% total %]', '[% full_query %]'); [% END %] [% IF (gotoPage && gotoNumber) %] [% IF (gotoNumber == 'first') %] --