From 67ffed7fec7f3b3a0db60e6f71060d5b43f03e94 Mon Sep 17 00:00:00 2001 From: Paul POULAIN Date: Wed, 28 May 2008 18:48:10 +0200 Subject: [PATCH] Respect BiblioDefaultView when search returns only 1 result & jump directly to the detail Signed-off-by: Joshua Ferraro --- catalogue/search.pl | 8 +++++++- opac/opac-search.pl | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index 01dd3fbede..b6c09134cc 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -492,7 +492,13 @@ for (my $i=0;$i<@servers;$i++) { ## If there's just one result, redirect to the detail page if ($total == 1) { my $biblionumber=@newresults[0]->{biblionumber}; - print $cgi->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber"); + if (C4::Context->preference('IntranetBiblioDefaultView') eq 'isbd') { + print $cgi->redirect("/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=$biblionumber"); + } elsif (C4::Context->preference('IntranetBiblioDefaultView') eq 'marc') { + print $cgi->redirect("/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=$biblionumber"); + } else { + print $cgi->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber"); + } exit; } if ($hits) { diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 6133d62e9a..c6a998980c 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -417,7 +417,13 @@ for (my $i=0;$i<=@servers;$i++) { ## If there's just one result, redirect to the detail page if ($total == 1) { my $biblionumber=@newresults[0]->{biblionumber}; - print $cgi->redirect("/cgi-bin/koha/opac-detail.pl?biblionumber=$biblionumber"); + if (C4::Context->preference('BiblioDefaultView') eq 'isbd') { + print $cgi->redirect("/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=$biblionumber"); + } elsif (C4::Context->preference('BiblioDefaultView') eq 'marc') { + print $cgi->redirect("/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=$biblionumber"); + } else { + print $cgi->redirect("/cgi-bin/koha/opac-detail.pl?biblionumber=$biblionumber"); + } exit; } if ($hits) { -- 2.39.5