Bug 20529: Remove other occurrences of decodeURIComponent from browser.js

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2021-07-09 16:01:43 +02:00
parent 125c5da32a
commit 5aaaa57ce4

View file

@ -32,9 +32,9 @@ 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_by=' + current_search.sort + '&gotoPage=detail.pl&gotoNumber=first&searchid=' + me.searchid + '&offset=' + newSearchPos;
window.location = '/cgi-bin/koha/catalogue/search.pl?' + current_search.query + '&limit=' + current_search.limit + '&sort_by=' + current_search.sort + '&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_by=' + 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?' + current_search.query + '&limit=' + current_search.limit + '&sort_by=' + current_search.sort + '&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]);
}
@ -81,7 +81,7 @@ KOHA.browser = function (searchid, biblionumber) {
$(document).ready(function () {
if (me.curPos > -1) {
var searchURL = '/cgi-bin/koha/catalogue/search.pl?' + current_search.query + '&limit=' + decodeURIComponent(current_search.limit) + '&sort_by=' + current_search.sort + '&searchid=' + me.searchid + '&offset=' + me.offset;
var searchURL = '/cgi-bin/koha/catalogue/search.pl?' + current_search.query + '&limit=' + current_search.limit + '&sort_by=' + current_search.sort + '&searchid=' + me.searchid + '&offset=' + me.offset;
var prevbutton;
var nextbutton;
if (me.curPos === 0 && parseInt(current_search.offset) === 1) {
@ -116,7 +116,7 @@ KOHA.browser = function (searchid, biblionumber) {
me.show_back_link = function () {
if (current_search) {
$(document).ready(function () {
var searchURL = '/cgi-bin/koha/catalogue/search.pl?' + decodeURIComponent(current_search.query) + '&limit=' + decodeURIComponent(current_search.limit) + '&sort_by=' + current_search.sort + '&searchid=' + me.searchid;
var searchURL = '/cgi-bin/koha/catalogue/search.pl?' + current_search.query + '&limit=' + current_search.limit + '&sort_by=' + current_search.sort + '&searchid=' + me.searchid;
$('#previous_search_link').replaceWith('<div><div class="browse-label"><a href="' + searchURL + '"><i class="fa fa-list"></i> ' + __("Go back to the results") + '</a></div></div>');
});
}