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

(-)a/catalogue/search.pl (-2 / +9 lines)
Lines 675-682 for (my $i=0;$i<@servers;$i++) { Link Here
675
} #/end of the for loop
675
} #/end of the for loop
676
#$template->param(FEDERATED_RESULTS => \@results_array);
676
#$template->param(FEDERATED_RESULTS => \@results_array);
677
677
678
$template->{'VARS'}->{'searchid'} = $cgi->param('searchid')
678
if ($cgi->param('searchid')) {
679
  || String::Random::random_string('ssssssss');
679
	$template->{'VARS'}->{'searchid'} = $cgi->param('searchid');
680
}
681
else {
682
	my $dt = DateTime->now(time_zone  => 'local');
683
	#We are generating a clean numeric datetime representation so we can easily compare them using the default javascript lexigraphic sorter.
684
	$template->{'VARS'}->{'searchid'} = 'scs_'.$dt->ymd('').$dt->hms(''); #scs == Staff Client 
685
}
686
680
my $gotonumber = $cgi->param('gotoNumber');
687
my $gotonumber = $cgi->param('gotoNumber');
681
if ($gotonumber eq 'last' || $gotonumber eq 'first') {
688
if ($gotonumber eq 'last' || $gotonumber eq 'first') {
682
    $template->{'VARS'}->{'gotoNumber'} = $gotonumber;
689
    $template->{'VARS'}->{'gotoNumber'} = $gotonumber;
(-)a/koha-tmpl/intranet-tmpl/js/browser.js (-1 / +13 lines)
Lines 40-45 KOHA.browser = function (searchid, biblionumber) { Link Here
40
                pagelen: newresults.length,
40
                pagelen: newresults.length,
41
                results: newresults
41
                results: newresults
42
            };
42
            };
43
44
            //Bug_11369 Cleaning up excess searchCookies to prevent cookie overflow in the browser memory.
45
            var allVisibleCookieKeys = Object.keys( $.cookie() );
46
            var scsCookieKeys = $.grep( allVisibleCookieKeys,
47
                function(elementOfArray, indexInArray) {
48
                    return ( elementOfArray.search(/^scs_\d/) != -1 ); //We are looking for specifically staff client searchCookies.
49
                }
50
            );
51
            if (scsCookieKeys.length >= 10) {
52
                scsCookieKeys.sort(); //Make sure they are in order, oldest first!
53
                $.removeCookie( scsCookieKeys[0], { path: '/' } );
54
            }
55
            //EO Bug_11369
43
        }
56
        }
44
        $.cookie(me.searchid, JSON.stringify(me.searchCookie), { path: '/' });
57
        $.cookie(me.searchid, JSON.stringify(me.searchCookie), { path: '/' });
45
        $(document).ready(function () {
58
        $(document).ready(function () {
46
- 

Return to bug 11369