From ba2c61b1b6bed78958e96e2488c689421f60bd29 Mon Sep 17 00:00:00 2001 From: Ian Walls Date: Thu, 8 Sep 2011 17:15:39 -0400 Subject: [PATCH] Enh 6165: Add OPACResultsSidebar system preference Adds a system preference for displaying content under the "Refine your Search" menu on OPAC search results. Arbitrary HTML can be added, like OpacNav, opacheader, opaccredits and other such system preferences Signed-off-by: Nicole C. Engard Signed-off-by: Chris Cormack --- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ .../prog/en/modules/admin/preferences/opac.pref | 5 +++++ koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc | 5 +++++ opac/opac-search.pl | 1 + 5 files changed, 19 insertions(+) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 8407505962..79d4893e47 100755 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -85,6 +85,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPasswordChange',1,'If ON, enables patron-initiated password change in OPAC (disable it when using LDAP auth)',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacPrivacy', '0', 'if ON, allows patrons to define their privacy rules (reading history)',NULL,'YesNo'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacreadinghistory',1,'If ON, enables display of Patron Circulation History in OPAC','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACResultsSidebar','','Define HTML to be included on the search results page, underneath the facets sidebar','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacsmallimage','','Enter a complete URL to an image to replace the default Koha logo','','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacstylesheet','','Enter a complete URL to use an alternate layout stylesheet in OPAC','','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacthemes','prog','Define the current theme for the OPAC interface.','','Themes'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index bdfc9acd4b..afdd9543a7 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -4439,6 +4439,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion($DBversion); } +$DBversion = "3.05.00.XXX"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACResultsSidebar','','Define HTML to be included on the search results page, underneath the facets sidebar','70|10','Textarea')"); + print "Upgrade to $DBversion done (add OPACResultsSidebar syspref (enh 6165))\n"; + SetVersion($DBversion); +} + =head1 FUNCTIONS 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 4a7c6522df..8bbf692f0d 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 @@ -164,6 +164,11 @@ OPAC: - pref: OPACMySummaryHTML type: textarea class: code + - + - "Include the following HTML under the facets in OPAC search results:" + - pref: OPACResultsSidebar + type: textarea + class: code - - pref: OpacAddMastheadLibraryPulldown choices: diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc b/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc index 7a2b743afd..4e6c935ed8 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/opac-facets.inc @@ -25,5 +25,10 @@ [% END %] +[% IF ( OPACResultsSidebar ) %] +
+[% OPACResultsSidebar %] +
+[% END %] [% END %] [% END %] diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 8f6b67a3c3..dfe4d742f0 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -405,6 +405,7 @@ if (C4::Context->preference('OpacSuppression')) { } $template->param ( LIMIT_INPUTS => \@limit_inputs ); +$template->param ( OPACResultsSidebar => C4::Context->preference('OPACResultsSidebar')); ## II. DO THE SEARCH AND GET THE RESULTS my $total = 0; # the total results for the whole set -- 2.39.5