From 817b1338384c1375c91d9c5b6cb0d6a0a1dc8e56 Mon Sep 17 00:00:00 2001 From: Nicole Engard Date: Sat, 11 Dec 2010 21:17:55 +0100 Subject: [PATCH] Bug 1997: new OPACNoResultsFound pref This patch adds a new preference to allow librarians to add content to the no results found page if they want. Signed-off-by: Katrin Fischer Changed surrounding

in template to

Will send follow up patch adding sys pref to translated sql files Signed-off-by: Chris Cormack --- installer/data/mysql/en/mandatory/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 6 ++++++ .../prog/en/modules/admin/preferences/opac.pref | 5 +++++ koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc | 8 +++++++- opac/opac-search.pl | 1 + 5 files changed, 20 insertions(+), 1 deletion(-) diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index 61fc22d4f4..0451c3fceb 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -73,6 +73,7 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacheader','','Add HTML to be included as a custom header in the OPAC','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opaclayoutstylesheet','opac.css','Enter the name of the layout CSS stylesheet to use in the OPAC','','free'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacMaintenance',0,'If ON, enables maintenance warning in OPAC','','YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OPACNoResultsFound','','Display this HTML when no results are found for a search in the OPAC','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacMainUserBlock','Welcome to Koha...\r\n
','A user-defined block of HTML in the main content area of the opac main page','70|10','Textarea'); INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('OpacNav','Important links here.','Use HTML tags to add navigational links to the left-hand navigational bar in OPAC','70|10','Textarea'); 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'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 4caadb31ce..b917ee8ce4 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3902,6 +3902,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = '3.03.00.008'; +if (C4::Context->preference('Version') < TransformToNum($DBversion)){ + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('OPACNoResultsFound','','Display this HTML when no results are found for a search in the OPAC','70|10','Textarea')"); + print "Upgrade to $DBversion done adding syspref OPACNoResultsFound to control what displays when no results are found for a search in the OPAC."; + 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 55560d39f5..acab30a76f 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 @@ -147,6 +147,11 @@ OPAC: yes: Add no: "Don't add" - a library select pulldown menu on the OPAC masthead. + - + - 'Display this HTML when no results are found for a search in the OPAC:' + - pref: OPACNoResultsFound + 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 878a4126f9..236f296a50 100644 --- a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc +++ b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc @@ -173,7 +173,7 @@

returned results. (related searches: ). /cgi-bin/koha/opac-search.pl?&sort_by=&format=rss2">Subscribe to this search -No Result found! +No Results Found!

No results match your search for in Catalog. /cgi-bin/koha/opac-search.pl?&format=rss2">Subscribe to this search @@ -181,5 +181,11 @@ You did not specify any search criteria.

+ +
+ +
+ +

diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 2bfcb6d6eb..88f3a2fa95 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -97,6 +97,7 @@ elsif (C4::Context->preference("marcflavour") eq "MARC21" ) { $template->param('usmarc' => 1); } $template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') ); +$template->param( 'OPACNoResultsFound' => C4::Context->preference('OPACNoResultsFound') ); if (C4::Context->preference('BakerTaylorEnabled')) { $template->param( -- 2.39.5