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 266-271 Searching: Link Here
266
                  1: "Display"
266
                  1: "Display"
267
                  0: "Don't display"
267
                  0: "Don't display"
268
            - ' 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.'
268
            - ' 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.'
269
        -
270
            - pref: OPACShowResultListOfOne
271
              choices:
272
                  1: "Show"
273
                  0: "Don't show"
274
            - ' 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.'
269
    Did you mean/spell checking:
275
    Did you mean/spell checking:
270
        -
276
        -
271
            - "Swedish service for spellchecking.<br/>"
277
            - "Swedish service for spellchecking.<br/>"
(-)a/opac/opac-search.pl (-3 / +4 lines)
Lines 756-764 for (my $i=0;$i<@servers;$i++) { Link Here
756
            $template->param( EnableOpacSearchHistory => 1 );
756
            $template->param( EnableOpacSearchHistory => 1 );
757
        }
757
        }
758
758
759
        ## If there's just one result, redirect to the detail page
759
        # If there's just one result, redirect to the detail page unless this
760
        # funtionality has been turned off with the syspref OPACShowResultListOfOne
760
        if ($total == 1 && $format ne 'rss'
761
        if ($total == 1 && $format ne 'rss'
761
        && $format ne 'opensearchdescription' && $format ne 'atom') {
762
        && $format ne 'opensearchdescription' && $format ne 'atom'
763
        && C4::Context->preference('OPACShowResultListOfOne') == 0 ) {
762
            my $biblionumber=$newresults[0]->{biblionumber};
764
            my $biblionumber=$newresults[0]->{biblionumber};
763
            if (C4::Context->preference('BiblioDefaultView') eq 'isbd') {
765
            if (C4::Context->preference('BiblioDefaultView') eq 'isbd') {
764
                print $cgi->redirect("/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=$biblionumber");
766
                print $cgi->redirect("/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=$biblionumber");
765
- 

Return to bug 25885