From 8f2d9cd6cef4cb97b8292a32f178525ea40ae7c8 Mon Sep 17 00:00:00 2001 From: Nicole Engard Date: Sun, 23 Aug 2009 05:41:34 -0400 Subject: [PATCH] Bug 1934: Add system preference to handle editing of 'More searches' This preference allows librarians to control which links appear in the 'More Searches' box on the opac detail page. If the preference is left blank the 'More Searches' menu will not apear on the opac detail page at all. Signed-off-by: Galen Charlton --- admin/systempreferences.pl | 1 + installer/data/mysql/en/mandatory/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl | 8 +++++--- opac/opac-detail.pl | 9 +++++++++ 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index 222f96ce49..4c856da96b 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -314,6 +314,7 @@ $tabsysprefs{OPACUserCSS} = "OPAC"; $tabsysprefs{OPACHighlightedWords} = "OPAC"; $tabsysprefs{OPACViewOthersSuggestions} = "OPAC"; $tabsysprefs{URLLinkText} = "OPAC"; +$tabsysprefs{OPACSearchForTitleIn} = "OPAC"; $tabsysprefs{OPACShelfBrowser} = "OPAC"; $tabsysprefs{OPACDisplayRequestPriority} = "OPAC"; $tabsysprefs{OPACAllowHoldDateInFuture} = "OPAC"; diff --git a/installer/data/mysql/en/mandatory/sysprefs.sql b/installer/data/mysql/en/mandatory/sysprefs.sql index b83cfdf6b8..ec042d4768 100644 --- a/installer/data/mysql/en/mandatory/sysprefs.sql +++ b/installer/data/mysql/en/mandatory/sysprefs.sql @@ -256,3 +256,4 @@ INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanatio INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'ReturnToShelvingCart', '0', '', 'If set, when any item is ''checked in'', it''s location code will be changed to CART.', 'YesNo'); INSERT INTO `systempreferences` ( `variable` , `value` , `options` , `explanation` , `type` ) VALUES ( 'DisplayClearScreenButton', '0', '', 'If set to yes, a clear screen button will appear on the circulation page.', 'YesNo'); INSERT INTO systempreferences (variable,value,options,explanation,type)VALUES('HidePatronName', '0', '', 'If this is switched on, patron''s cardnumber will be shown instead of their name on the holds and catalog screens', 'YesNo'); +INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACSearchForTitleIn','
  • Other Libraries (WorldCat)
  • \n
  • Other Databases (Google Scholar)
  • \n
  • Online Stores (Bookfinder.com)
  • ','Enter the HTML that will appear in the \'Search for this title in\' box on the detail page in the OPAC. Enter TITLE, AUTHOR, or ISBN in place of their respective variables in the URL. Leave blank to disable \'More Searches\' menu.','70|10','Textarea') diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 4cdff405bb..567aeb1fea 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -2593,6 +2593,13 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { print " Upgrade to $DBversion done (changed catalogue to catalog per the standard)\n"; } +$DBversion = '3.01.00.XXX'; + if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OPACSearchForTitleIn','
  • Other Libraries (WorldCat)
  • \n
  • Other Databases (Google Scholar)
  • \n
  • Online Stores (Bookfinder.com)
  • ','Enter the HTML that will appear in the \'Search for this title in\' box on the detail page in the OPAC. Enter TITLE, AUTHOR, or ISBN in place of their respective variables in the URL. Leave blank to disable \'More Searches\' menu.','70|10','Textarea')"); + SetVersion ($DBversion); + print "Add OPACSearchForTitleIn system preference which will hold the links found on opac_detail under 'More Searches')\n"; + } + =item DropAllForeignKeys($table) Drop all foreign keys of the table $table diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl index 7ee17cf220..12a5003550 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tmpl @@ -762,16 +762,18 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
  • More searches
  • + +
    diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index f0ba0c5c87..dd73cfcc39 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -542,4 +542,13 @@ if (C4::Context->preference('TagsEnabled') and $tag_quantity = C4::Context->pref 'sort'=>'-weight', limit=>$tag_quantity})); } +#Search for title in links +if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){ + $search_for_title =~ s/AUTHOR/$dat->{author}/g; + $search_for_title =~ s/TITLE/$dat->{title}/g; + $search_for_title =~ s/ISBN/$isbn/g; + $template->param('OPACSearchForTitleIn' => $search_for_title); +} + + output_html_with_http_headers $query, $cookie, $template->output; -- 2.39.5