#
# This file is part of Koha
#
-# Koha is free software; you can redistribute it and/or modify it under the
-# terms of the GNU General Public License as published by the Free Software
-# Foundation; either version 2 of the License, or (at your option) any later
-# version.
+# Koha is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
#
-# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
-# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
-# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+# Koha is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License along
-# with Koha; if not, write to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+# You should have received a copy of the GNU General Public License
+# along with Koha; if not, see <http://www.gnu.org/licenses>.
=head1 NAME
my $DisplayMultiPlaceHold = C4::Context->preference("DisplayMultiPlaceHold");
# create a new CGI object
# FIXME: no_undef_params needs to be tested
-use CGI qw('-no_undef_params');
+use CGI qw('-no_undef_params' -utf8 );
my $cgi = new CGI;
my ($template,$borrowernumber,$cookie);
my @advanced_search_types = split(/\|/, $advanced_search_types);
foreach my $advanced_srch_type (@advanced_search_types) {
+ $advanced_srch_type =~ s/^\s*//;
+ $advanced_srch_type =~ s/\s*$//;
if ($advanced_srch_type eq 'itemtypes') {
# itemtype is a special case, since it's not defined in authorized values
my @itypesloop;
$this_cgi =~ m/(.*?)=(.*)/;
my $input_name = $1;
my $input_value = $2;
- push @query_inputs, { input_name => $input_name, input_value => $input_value };
+ push @query_inputs, { input_name => $input_name, input_value => Encode::decode_utf8( uri_unescape( $input_value ) ) };
if ($input_name eq 'idx') {
$scan_index_to_use = $input_value; # unless $scan_index_to_use;
}
my $input_name = $1;
my $input_value = $2;
$input_name =~ s/=$//;
- push @limit_inputs, { input_name => $input_name, input_value => uri_unescape($input_value) };
+ push @limit_inputs, { input_name => $input_name, input_value => Encode::decode_utf8( uri_unescape($input_value) ) };
}
$template->param ( LIMIT_INPUTS => \@limit_inputs );
# This sorts the facets into alphabetical order
if ($facets) {
foreach my $f (@$facets) {
- $f->{facets} = [ sort { uc($a->{facet_title_value}) cmp uc($b->{facet_title_value}) } @{ $f->{facets} } ];
+ $f->{facets} = [ sort { uc($a->{facet_label_value}) cmp uc($b->{facet_label_value}) } @{ $f->{facets} } ];
}
}
if ($@ || $error) {
$template->{'VARS'}->{'gotoPage'} = $gotopage
if $gotopage =~ m/^(ISBD|labeledMARC|MARC|more)?detail.pl$/;
-my @input_values = map { Encode::decode_utf8($_->{input_value}) } @limit_inputs;
for my $facet ( @$facets ) {
for my $entry ( @{ $facet->{facets} } ) {
my $index = $entry->{type_link_value};
my $value = $entry->{facet_link_value};
- $entry->{active} = grep { $_ eq qq{$index:$value} } @input_values;
+ $entry->{active} = grep { $_->{input_value} eq qq{$index:$value} } @limit_inputs;
}
}