Bugzilla – Attachment 28416 Details for
Bug 12296
OPAC search box should be customisable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12296 - make search box customisable with OpacCustomSearch
Bug-12296---make-search-box-customisable-with-Opac.patch (text/plain), 4.19 KB, created by
Robin Sheat
on 2014-05-22 02:24:13 UTC
(
hide
)
Description:
Bug 12296 - make search box customisable with OpacCustomSearch
Filename:
MIME Type:
Creator:
Robin Sheat
Created:
2014-05-22 02:24:13 UTC
Size:
4.19 KB
patch
obsolete
>From 1706866513bb212da84c14f6a100588e3f716935 Mon Sep 17 00:00:00 2001 >From: Robin Sheat <robin@catalyst.net.nz> >Date: Wed, 21 May 2014 16:38:31 +1200 >Subject: [PATCH] Bug 12296 - make search box customisable with > OpacCustomSearch > >This allows the search box to be replaced by some custom HTML, useful >when you're needing to integrate with some other search system, and >don't want to maintain a template change across upgrades. > >Test plan: >* Install patch >* Look at the OPAC, see that nothing has changed. >* Change the OpacCustomSearch syspref to something like <h1>Zuul</h1> >* Look at the OPAC again, you can no longer search, there is only Zuul. >--- > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 12 ++++++++++++ > .../prog/en/modules/admin/preferences/opac.pref | 5 +++++ > koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc | 7 ++++++- > 4 files changed, 24 insertions(+), 1 deletion(-) > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index be2f63f..e7cb594 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/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',''); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 421e772..9112fce 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -8471,6 +8471,18 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.12.10.001"; >+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) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >index 428f569..b553d62 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref >+++ b/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 >diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc >index 28449fc..f899652 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc >@@ -28,7 +28,9 @@ > > [% IF ( OpacPublic ) %] > <div id="fluid-offset"> >-[% UNLESS ( advsearch ) %]<form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform"> >+[% UNLESS ( advsearch ) %] >+[% IF Koha.Preference('OpacCustomSearch') == '' %] >+<form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform"> > <label for="masthead_search" class="left"> Search > [% UNLESS Koha.Preference( 'OpacAddMastheadLibraryPulldown' ) == 1 %] > [% IF ( mylibraryfirst ) %] (in [% mylibraryfirst %] only)[% END %] >@@ -124,6 +126,9 @@ > [% IF ( virtualshelves ) %]<a href="/cgi-bin/koha/opac-shelves.pl" id="listsmenulink">Lists</a>[% END %] > </form> > [% ELSE %] >+ [% Koha.Preference('OpacCustomSearch') %] >+[% END %] >+[% ELSE %] > <div style="width:80%;*margin-bottom:-30px;"> > [% IF ( virtualshelves ) %]<a href="/cgi-bin/koha/opac-shelves.pl" id="listsmenulink">Lists</a>[% END %][% IF ( opacbookbag ) %]<span id="cmspan"></span>[% END %] > </div> >-- >1.8.3.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12296
:
28416
|
28476
|
28928
|
28942
|
29203
|
29341
|
32520