From b7d3329ecff853c67c36951894483c60738cd7f5 Mon Sep 17 00:00:00 2001 From: rangi Date: Fri, 29 Jul 2005 00:56:22 +0000 Subject: [PATCH] If MARC is switched off, it will now jump to detail.pl instead of MARCdetail.pl when only one result is found This provides for a more consistent experience --- search.marc/search.pl | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/search.marc/search.pl b/search.marc/search.pl index d2da64d41c..49da444f5d 100755 --- a/search.marc/search.pl +++ b/search.marc/search.pl @@ -142,7 +142,16 @@ if ($op eq "do_search") { $startfrom*$resultsperpage, $resultsperpage,$orderby,$desc_or_asc); if ($total == 1) { # if only 1 answer, jump directly to the biblio - print $query->redirect("/cgi-bin/koha/MARCdetail.pl?bib=".@$results[0]->{biblionumber}); + # here we need to check if MARC searching is turned on or off. + # if on, go to MARCdetail.pl else go to + # detail.pl + my $marc_bool = C4::Context->boolean_preference("MARC") || 0; + if ($marc_bool eq "1") { + print $query->redirect("/cgi-bin/koha/MARCdetail.pl?bib=".@$results[0]->{biblionumber}); + } + else { + print $query->redirect("/cgi-bin/koha/detail.pl?bib=".@$results[0]->{biblionumber}); + } exit } ($template, $loggedinuser, $cookie) -- 2.39.2