#
# 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>.
# Script to perform searching
# Mostly copied from search.pl, see POD there
elsif (C4::Context->preference("marcflavour") eq "MARC21" ) {
$template->param('usmarc' => 1);
}
-$template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') );
+
$template->param( 'OPACNoResultsFound' => C4::Context->preference('OPACNoResultsFound') );
$template->param(
# load the branches
+if ($cgi->param("returntosearch")) {
+ $template->param('ReturnToSearch' => 1);
+}
+if ($cgi->cookie("search_path_code")) {
+ my $pathcode = $cgi->cookie("search_path_code");
+ given ($pathcode)
+ {
+ when ('"ads"') { $template->param('ReturnPath' => '/cgi-bin/koha/opac-search.pl?returntosearch=1'); }
+ when ('"exs"') {
+ $template->param('ReturnPath' => '/cgi-bin/koha/opac-search.pl?expanded_options=1&returntosearch=1');
+ }
+ default {warn "ReturnPath swith error";}
+ }
+}
+
my $branches = GetBranches(); # used later in *getRecords, probably should be internalized by those functions after caching in C4::Branch is established
$template->param(
searchdomainloop => GetBranchCategories('searchdomain'),
# box should only appear on the last, etc.
my @search_boxes_array;
my $search_boxes_count = 3; # begin whith 3 boxes
+ $template->param( search_boxes_count => $search_boxes_count );
+
+ if ($cgi->cookie("num_paragraph")){
+ $search_boxes_count = $cgi->cookie("num_paragraph");
+ }
+
for (my $i=1;$i<=$search_boxes_count;$i++) {
# if it's the first one, don't display boolean option, but show scan indexes
if ($i==1) {
# * multivalued CGI paramaters are returned as a packaged string separated by "\0" (null)
my $params = $cgi->Vars;
my $tag;
-$tag = $params->{tag} if $params->{tag};
-
+if ( $params->{tag} ) {
+ $tag = $params->{tag};
+ $template->param( tag => $tag );
+}
# String with params with the search criteria for the paging in opac-detail
# param value is URI encoded and params separator is HTML encode (&)
} #/end of the for loop
#$template->param(FEDERATED_RESULTS => \@results_array);
-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;
}
}