@@ -, +, @@ the OPAC --- ...32-add_OPACWikipediaSearchSuggestions_syspref.sql | 7 +++++++ installer/data/mysql/sysprefs.sql | 1 + .../prog/en/modules/admin/preferences/opac.pref | 7 +++++++ .../opac-tmpl/bootstrap/en/includes/opac-bottom.inc | 4 ++++ koha-tmpl/opac-tmpl/bootstrap/js/wikipedia-search.js | 20 ++++++++++++++++++++ 5 files changed, 39 insertions(+) create mode 100644 installer/data/mysql/atomicupdate/bug_25532-add_OPACWikipediaSearchSuggestions_syspref.sql create mode 100644 koha-tmpl/opac-tmpl/bootstrap/js/wikipedia-search.js --- a/installer/data/mysql/atomicupdate/bug_25532-add_OPACWikipediaSearchSuggestions_syspref.sql +++ a/installer/data/mysql/atomicupdate/bug_25532-add_OPACWikipediaSearchSuggestions_syspref.sql @@ -0,0 +1,7 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + $dbh->do(q{ INSERT IGNORE INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `type` ) VALUES ( "OPACWikipediaSearchSuggestions", 0, NULL, "Enable a search suggestion to the OPAC Search box.","YesNo" ) }); + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 25532 - Add a wikipedia-style search suggestion feature to the OPAC)\n"; +} --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -433,6 +433,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OpacResetPassword','0','','Shows the ''Forgot your password?'' link in the OPAC','YesNo'), ('OPACResultsLibrary', 'homebranch', 'homebranch|holdingbranch', 'Defines whether the OPAC displays the holding or home branch in search results when using XSLT', 'Choice'), ('OPACResultsSidebar','','70|10','Define HTML to be included on the search results page, underneath the facets sidebar','Textarea'), +('OPACWikipediaSearchSuggestions','0','NULL','Enable search suggestions based on data entered into the search box','YesNo'), ('OPACSearchForTitleIn','
  • Other Libraries (WorldCat)
  • \n
  • Other Databases (Google Scholar)
  • \n
  • Online Stores (Bookfinder.com)
  • \n
  • Open Library (openlibrary.org)
  • ','70|10','Enter the HTML that will appear in the \'Search for this title in\' box on the detail page in the OPAC. Enter {TITLE}, {AUTHOR}, or {ISBN} in place of their respective variables in the URL. Leave blank to disable \'More Searches\' menu.','Textarea'), ('OpacSeparateHoldings','0',NULL,'Separate current branch holdings from other holdings (OPAC)','YesNo'), ('OpacSeparateHoldingsBranch','homebranch','homebranch|holdingbranch','Branch used to separate holdings (OPAC)','Choice'), --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -563,6 +563,13 @@ OPAC: syntax: text/html class: code - + - pref: OPACWikipediaSearchSuggestions + default: 0 + choices: + yes: Enable + no: Disable + - "search suggestions based on data entered into the search box" + - - pref: OpacBrowseSearch default: 0 choices: --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc +++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/opac-bottom.inc @@ -121,6 +121,10 @@ $.widget.bridge('uitooltip', $.ui.tooltip); [% Asset.js("js/amazonimages.js") | $raw %] [% END %] +[% IF Koha.Preference( 'OPACWikipediaSearchSuggestions' ) == 1 %] +[% Asset.js("js/wikipedia-search.js") | $raw %] +[% END %] +