@@ -, +, @@ OpacCustomSearch --- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 12 ++ .../prog/en/modules/admin/preferences/opac.pref | 5 + .../opac-tmpl/bootstrap/en/includes/masthead.inc | 197 +++++++++++---------- koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc | 7 +- 5 files changed, 125 insertions(+), 97 deletions(-) --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -441,3 +441,4 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'), ('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo') ; +INSERT INTO systempreferences (variable,value) VALUES('OpacCustomSearch',''); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -8483,6 +8483,18 @@ if ( CheckVersion($DBversion) ) { SetVersion ($DBversion); } +$DBversion = "XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do( + q{ +INSERT INTO systempreferences (variable,value) VALUES('OpacCustomSearch',''); +} + ); + print +"Upgrade to $DBversion done (Bug 12296 - search box replaceable with a system preference)\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -300,6 +300,11 @@ OPAC: - pref: NoLoginInstructions type: textarea class: code + - + - "Replace the search box at the top of OPAC pages with the following HTML:" + - pref: OpacCustomSearch + type: textarea + class: code Features: - - pref: opacuserlogin --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc +++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc @@ -1,3 +1,4 @@ +[% USE Koha %]
[% END # / UNLESS advsearch %] --- a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc +++ a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc @@ -28,7 +28,9 @@ [% IF ( OpacPublic ) %]
-[% UNLESS ( advsearch ) %]
+[% UNLESS ( advsearch ) %] +[% IF Koha.Preference('OpacCustomSearch') == '' %] +