Bug 14351: Remove given-when from opac-search.pl

Reformats given-when to if-elsif-else in opac-search.pl
to remove the experimental feature and with it a lot
of warnings from the logs.

To test:
- Do several different advanced searches with and
  without expanded search options
- Verify the link back to the search appears above
  the results list and works correctly

See also: test plan on bug 13307

NOTE: Even installed firefox plug in to edit cookies to
      trigger else case. :)

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Katrin Fischer 2015-06-08 01:49:24 +02:00 committed by Tomas Cohen Arazi
parent 2fe241cc0f
commit 38048bc420
1 changed files with 8 additions and 7 deletions

View File

@ -189,13 +189,14 @@ if ($cgi->param("returntosearch")) {
}
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";}
if ($pathcode eq '"ads"') {
$template->param('ReturnPath' => '/cgi-bin/koha/opac-search.pl?returntosearch=1');
}
elsif ($pathcode eq '"exs"') {
$template->param('ReturnPath' => '/cgi-bin/koha/opac-search.pl?expanded_options=1&returntosearch=1');
}
else {
warn "ReturnPath switch error";
}
}