Bug 11369: (follow-up) generate searchid in browser.js
The search browser feature uses nearly only the browser.js file.
That is why I propose to move the searchid generation from search.pl
to browser.js.
We then use Date.getTime() to use current timestamp as searchid,
prefixed by 'scs_' like before.
Test by using test plan of main patch :
Too many search cursor cookies overflow HTTP-header size, when
making multiple searches in the staff client
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Passes tests and QA script.
Tested the browse functionality in staff by using the different
options (back to results, next, previous, etc) and the batch
modifications for items. An old cookie can cause a Javascript error,
but after restarting the browser/deleting cookies it all works
correctly.
Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit c4f1765013)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
7ee0085b2e
commit
4e3a5051e6
|
|
@ -675,14 +675,7 @@ for (my $i=0;$i<@servers;$i++) {
|
|||
} #/end of the for loop
|
||||
#$template->param(FEDERATED_RESULTS => \@results_array);
|
||||
|
||||
if ($cgi->param('searchid')) {
|
||||
$template->{'VARS'}->{'searchid'} = $cgi->param('searchid');
|
||||
}
|
||||
else {
|
||||
my $dt = DateTime->now(time_zone => 'local');
|
||||
#We are generating a clean numeric datetime representation so we can easily compare them using the default javascript lexigraphic sorter.
|
||||
$template->{'VARS'}->{'searchid'} = 'scs_'.$dt->ymd('').$dt->hms(''); #scs == Staff Client
|
||||
}
|
||||
$template->{'VARS'}->{'searchid'} = $cgi->param('searchid');
|
||||
|
||||
my $gotonumber = $cgi->param('gotoNumber');
|
||||
if ($gotonumber eq 'last' || $gotonumber eq 'first') {
|
||||
|
|
|
|||
|
|
@ -2,13 +2,16 @@ if ( KOHA === undefined ) var KOHA = {};
|
|||
|
||||
KOHA.browser = function (searchid, biblionumber) {
|
||||
var me = this;
|
||||
|
||||
if (!searchid) {
|
||||
// We are generating a clean numeric datetime representation so we can easily compare them using the default javascript lexigraphic sorter.
|
||||
searchid = 'scs_' + (new Date()).getTime(); // scs for Staff Client Search
|
||||
}
|
||||
this.searchid = searchid;
|
||||
|
||||
if (me.searchid) {
|
||||
var cookie = $.cookie(me.searchid)
|
||||
if (cookie) {
|
||||
me.searchCookie = JSON.parse(cookie);
|
||||
}
|
||||
var cookie = $.cookie(me.searchid)
|
||||
if (cookie) {
|
||||
me.searchCookie = JSON.parse(cookie);
|
||||
}
|
||||
|
||||
var browseRecords = function (movement) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue