View | Details | Raw Unified | Return to bug 35728
Collapse All | Expand All

(-)a/catalogue/search.pl (-8 / +9 lines)
Lines 610-628 for (my $i=0;$i<@servers;$i++) { Link Here
610
        }
610
        }
611
611
612
        ## If there's just one result, redirect to the detail page unless doing an index scan
612
        ## If there's just one result, redirect to the detail page unless doing an index scan
613
        if ($total == 1 && !$scan) {
613
        if ( $total == 1 && !$scan && C4::Context->preference('RedirectToSoleResult') ) {
614
            my $biblionumber = $newresults[0]->{biblionumber};
614
            my $biblionumber = $newresults[0]->{biblionumber};
615
            my $defaultview = C4::Context->preference('IntranetBiblioDefaultView');
615
            my $defaultview  = C4::Context->preference('IntranetBiblioDefaultView');
616
            my $views = { C4::Search::enabled_staff_search_views };
616
            my $views        = {C4::Search::enabled_staff_search_views};
617
            if ($defaultview eq 'isbd' && $views->{can_view_ISBD}) {
617
            if ( $defaultview eq 'isbd' && $views->{can_view_ISBD} ) {
618
                print $cgi->redirect("/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=$biblionumber&found1=1");
618
                print $cgi->redirect("/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=$biblionumber&found1=1");
619
            } elsif  ($defaultview eq 'marc' && $views->{can_view_MARC}) {
619
            } elsif ( $defaultview eq 'marc' && $views->{can_view_MARC} ) {
620
                print $cgi->redirect("/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=$biblionumber&found1=1");
620
                print $cgi->redirect("/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=$biblionumber&found1=1");
621
            } elsif  ($defaultview eq 'labeled_marc' && $views->{can_view_labeledMARC}) {
621
            } elsif ( $defaultview eq 'labeled_marc' && $views->{can_view_labeledMARC} ) {
622
                print $cgi->redirect("/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=$biblionumber&found1=1");
622
                print $cgi->redirect(
623
                    "/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=$biblionumber&found1=1");
623
            } else {
624
            } else {
624
                print $cgi->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&found1=1");
625
                print $cgi->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&found1=1");
625
            } 
626
            }
626
            exit;
627
            exit;
627
        }
628
        }
628
629
(-)a/opac/opac-search.pl (-7 / +10 lines)
Lines 746-761 for (my $i=0;$i<@servers;$i++) { Link Here
746
        }
746
        }
747
747
748
        ## If there's just one result, redirect to the detail page
748
        ## If there's just one result, redirect to the detail page
749
        if ($total == 1 && $format ne 'rss'
749
        if (   $total == 1
750
        && $format ne 'opensearchdescription' && $format ne 'atom') {
750
            && $format ne 'rss'
751
            my $biblionumber=$newresults[0]->{biblionumber};
751
            && $format ne 'opensearchdescription'
752
            if (C4::Context->preference('BiblioDefaultView') eq 'isbd') {
752
            && $format ne 'atom'
753
            && C4::Context->preference('RedirectToSoleResult') )
754
        {
755
            my $biblionumber = $newresults[0]->{biblionumber};
756
            if ( C4::Context->preference('BiblioDefaultView') eq 'isbd' ) {
753
                print $cgi->redirect("/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=$biblionumber");
757
                print $cgi->redirect("/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=$biblionumber");
754
            } elsif  (C4::Context->preference('BiblioDefaultView') eq 'marc') {
758
            } elsif ( C4::Context->preference('BiblioDefaultView') eq 'marc' ) {
755
                print $cgi->redirect("/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=$biblionumber");
759
                print $cgi->redirect("/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=$biblionumber");
756
            } else {
760
            } else {
757
                print $cgi->redirect("/cgi-bin/koha/opac-detail.pl?biblionumber=$biblionumber");
761
                print $cgi->redirect("/cgi-bin/koha/opac-detail.pl?biblionumber=$biblionumber");
758
            } 
762
            }
759
            exit;
763
            exit;
760
        }
764
        }
761
        if ($hits) {
765
        if ($hits) {
762
- 

Return to bug 35728