From 04042fea6e4eefabda1fcfc579883861a4ee2a95 Mon Sep 17 00:00:00 2001 From: Nicole Engard Date: Tue, 11 May 2010 10:59:27 -0400 Subject: [PATCH 1/2] [SIGNED-OFF] Bug 1997: new OPACNoResultsFound pref Content-Type: text/plain; charset="utf-8" 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 --- installer/data/mysql/en/mandatory/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 11 +++++++++++ .../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, 25 insertions(+), 1 deletions(-) diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index d4fb9a2..be7b6c9 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 d093946..e3ee37a 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -3876,6 +3876,17 @@ VALUES SetVersion ($DBversion); }; + +$DBversion = '3.03.00.XXX'; +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); +} + +=item DropAllForeignKeys($table) + + =head1 FUNCTIONS =head2 DropAllForeignKeys($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 55560d3..acab30a 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 878a412..236f296 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 2bfcb6d..88f3a2f 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( -- 1.7.1