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

(-)a/installer/data/mysql/atomicupdate/bug25885-show-result-list-for-one-hit.perl (+9 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
     $dbh->do(q{
4
         INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type)
5
         VALUES ('OPACShowResultListOfOne','0','Show the result list even if there is only one hit.',NULL,'YesNo')
6
     });
7
8
    NewVersion( $DBversion, 25885, 'OPACShowResultListOfOne, show result list if there is only one hit' );
9
}
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 493-498 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
493
('OpenURLImageLocation', '', NULL, 'Location of image for OpenURL links', 'Free'),
493
('OpenURLImageLocation', '', NULL, 'Location of image for OpenURL links', 'Free'),
494
('OPACFineNoRenewalsIncludeCredits','1',NULL,'If enabled the value specified in OPACFineNoRenewals should include any unapplied account credits in the calculation','YesNo'),
494
('OPACFineNoRenewalsIncludeCredits','1',NULL,'If enabled the value specified in OPACFineNoRenewals should include any unapplied account credits in the calculation','YesNo'),
495
('OPACShowOpenURL', '0', NULL, 'Enable display of OpenURL links in OPAC search results and detail page', 'YesNo'),
495
('OPACShowOpenURL', '0', NULL, 'Enable display of OpenURL links in OPAC search results and detail page', 'YesNo'),
496
('OPACShowResultListOfOne', '0', NULL, 'Show the result list even if there is only one hit.', 'YesNo'),
496
('OPACOpenURLItemTypes', '', NULL, 'Show the OpenURL link only for these item types', 'Free'),
497
('OPACOpenURLItemTypes', '', NULL, 'Show the OpenURL link only for these item types', 'Free'),
497
('OrderPdfFormat','pdfformat::layout3pages','Controls what script is used for printing (basketgroups)','','free'),
498
('OrderPdfFormat','pdfformat::layout3pages','Controls what script is used for printing (basketgroups)','','free'),
498
('OrderPriceRounding','','|nearest_cent','Local preference for rounding orders before calculations to ensure correct calculations','Choice'),
499
('OrderPriceRounding','','|nearest_cent','Local preference for rounding orders before calculations to ensure correct calculations','Choice'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/searching.pref (+6 lines)
Lines 273-278 Searching: Link Here
273
                  1: "Display"
273
                  1: "Display"
274
                  0: "Don't display"
274
                  0: "Don't display"
275
            - ' Koha record level itemtype info on detail and result pages in the OPAC and staff interface. This info also displays if the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=item-level_itypes">item-level_itypes</a> system preference is set to bibliographic record.'
275
            - ' Koha record level itemtype info on detail and result pages in the OPAC and staff interface. This info also displays if the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=item-level_itypes">item-level_itypes</a> system preference is set to bibliographic record.'
276
        -
277
            - pref: OPACShowResultListOfOne
278
              choices:
279
                  1: "Show"
280
                  0: "Don't show"
281
            - ' the result list if there is only one hit. This is especially useful if you use a service like OverDrive and want to display the link on the result list, without automatically redirecting to detail view for a single hit.'
276
    Did you mean/spell checking:
282
    Did you mean/spell checking:
277
        -
283
        -
278
            - "Swedish service for spellchecking.<br/>"
284
            - "Swedish service for spellchecking.<br/>"
(-)a/opac/opac-search.pl (-3 / +4 lines)
Lines 789-797 for (my $i=0;$i<@servers;$i++) { Link Here
789
            $template->param( EnableOpacSearchHistory => 1 );
789
            $template->param( EnableOpacSearchHistory => 1 );
790
        }
790
        }
791
791
792
        ## If there's just one result, redirect to the detail page
792
        # If there's just one result, redirect to the detail page unless this
793
        # funtionality has been turned off with the syspref OPACShowResultListOfOne
793
        if ($total == 1 && $format ne 'rss'
794
        if ($total == 1 && $format ne 'rss'
794
        && $format ne 'opensearchdescription' && $format ne 'atom') {
795
        && $format ne 'opensearchdescription' && $format ne 'atom'
796
        && C4::Context->preference('OPACShowResultListOfOne') == 0 ) {
795
            my $biblionumber=$newresults[0]->{biblionumber};
797
            my $biblionumber=$newresults[0]->{biblionumber};
796
            if (C4::Context->preference('BiblioDefaultView') eq 'isbd') {
798
            if (C4::Context->preference('BiblioDefaultView') eq 'isbd') {
797
                print $cgi->redirect("/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=$biblionumber");
799
                print $cgi->redirect("/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=$biblionumber");
798
- 

Return to bug 25885