From 98edbf00cc10c908820eb1126a176ed12a04300d Mon Sep 17 00:00:00 2001 From: Fridolin Somers Date: Wed, 26 Feb 2014 17:03:13 +0100 Subject: [PATCH] Bug 11369: (follow-up) Correct usage of me.searchid in browser.js In browser.js, at creation of browser, the searchid is transmited to JS object into me.searchid. To be consistant, me.searchid should always be use, never searchid alone. In browseRecords function, setting searchid as parameter is useless because it is defined in me.searchid. Test with test plan of Bug 10404 Signed-off-by: Kyle M Hall Signed-off-by: Katrin Fischer Signed-off-by: Galen Charlton --- koha-tmpl/intranet-tmpl/js/browser.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/js/browser.js b/koha-tmpl/intranet-tmpl/js/browser.js index c203d3e24f..4ebc29cb28 100644 --- a/koha-tmpl/intranet-tmpl/js/browser.js +++ b/koha-tmpl/intranet-tmpl/js/browser.js @@ -5,18 +5,18 @@ KOHA.browser = function (searchid, biblionumber) { this.searchid = searchid; if (me.searchid) { - var cookie = $.cookie(searchid) + var cookie = $.cookie(me.searchid) if (cookie) { me.searchCookie = JSON.parse(cookie); } } - var browseRecords = function (searchid, movement) { + var browseRecords = function (movement) { var newSearchPos = me.curPos + movement; if (newSearchPos > me.searchCookie.results.length - 1) { - window.location = '/cgi-bin/koha/catalogue/search.pl?' + decodeURIComponent(me.searchCookie.query) + '&limit=' + decodeURIComponent(me.searchCookie.limit) + '&sort=' + me.searchCookie.sort + '&gotoPage=detail.pl&gotoNumber=first&searchid=' + searchid + '&offset=' + newSearchPos; + window.location = '/cgi-bin/koha/catalogue/search.pl?' + decodeURIComponent(me.searchCookie.query) + '&limit=' + decodeURIComponent(me.searchCookie.limit) + '&sort=' + me.searchCookie.sort + '&gotoPage=detail.pl&gotoNumber=first&searchid=' + me.searchid + '&offset=' + newSearchPos; } else if (newSearchPos < 0) { - window.location = '/cgi-bin/koha/catalogue/search.pl?' + decodeURIComponent(me.searchCookie.query) + '&limit=' + decodeURIComponent(me.searchCookie.limit) + '&sort=' + me.searchCookie.sort + '&gotoPage=detail.pl&gotoNumber=last&searchid=' + searchid + '&offset=' + (me.offset - me.searchCookie.pagelen); + window.location = '/cgi-bin/koha/catalogue/search.pl?' + decodeURIComponent(me.searchCookie.query) + '&limit=' + decodeURIComponent(me.searchCookie.limit) + '&sort=' + me.searchCookie.sort + '&gotoPage=detail.pl&gotoNumber=last&searchid=' + me.searchid + '&offset=' + (me.offset - me.searchCookie.pagelen); } else { window.location = window.location.href.replace('biblionumber=' + biblionumber, 'biblionumber=' + me.searchCookie.results[newSearchPos]); } @@ -86,11 +86,11 @@ KOHA.browser = function (searchid, biblionumber) { $('#menu').before('
' + prevbutton + nextbutton + '
'); $('a#browse-previous').click(function (ev) { ev.preventDefault(); - browseRecords(searchid, -1); + browseRecords(-1); }); $('a#browse-next').click(function (ev) { ev.preventDefault(); - browseRecords(me.searchid, 1); + browseRecords(1); }); $('a[href*="biblionumber="]').click(function (ev) { ev.preventDefault(); -- 2.39.5