Lines 30-35
use Koha::Libraries;
Link Here
|
30 |
use Koha::Token; |
30 |
use Koha::Token; |
31 |
|
31 |
|
32 |
use Try::Tiny; |
32 |
use Try::Tiny; |
|
|
33 |
use URI::Escape; |
33 |
|
34 |
|
34 |
our $cgi = CGI->new; |
35 |
our $cgi = CGI->new; |
35 |
my $illRequests = Koha::Illrequests->new; |
36 |
my $illRequests = Koha::Illrequests->new; |
Lines 233-247
if ( $backends_available ) {
Link Here
|
233 |
|
234 |
|
234 |
# If we receive a pre-filter, make it available to the template |
235 |
# If we receive a pre-filter, make it available to the template |
235 |
my $possible_filters = ['borrowernumber']; |
236 |
my $possible_filters = ['borrowernumber']; |
236 |
my $active_filters = []; |
237 |
my $active_filters = {}; |
237 |
foreach my $filter(@{$possible_filters}) { |
238 |
foreach my $filter(@{$possible_filters}) { |
238 |
if ($params->{$filter}) { |
239 |
if ($params->{$filter}) { |
239 |
push @{$active_filters}, "$filter=$params->{$filter}"; |
240 |
# We shouldn't need to escape $filter here since we're using |
|
|
241 |
# a whitelist, but just to be sure... |
242 |
$active_filters->{uri_escape_utf8($filter)} = |
243 |
uri_escape_utf8(scalar $params->{$filter}) |
240 |
} |
244 |
} |
241 |
} |
245 |
} |
242 |
if (scalar @{$active_filters} > 0) { |
246 |
if (keys %{$active_filters}) { |
|
|
247 |
my @tpl_arr; |
248 |
foreach my $key (keys %{$active_filters}) { |
249 |
push @tpl_arr, $key . "=" . $active_filters->{$key}; |
250 |
} |
243 |
$template->param( |
251 |
$template->param( |
244 |
prefilters => join(",", @{$active_filters}) |
252 |
prefilters => join("&", @tpl_arr) |
245 |
); |
253 |
); |
246 |
} |
254 |
} |
247 |
|
255 |
|