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 <gmcharlt@gmail.com>
This commit is contained in:
Nicole Engard 2009-08-23 05:41:34 -04:00 committed by Galen Charlton
parent 766034cfd1
commit 8f2d9cd6ce
5 changed files with 23 additions and 3 deletions

View File

@ -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";

View File

@ -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','<li class="yuimenuitem"><a target="_blank" class="yuimenuitemlabel" href="http://worldcat.org/search?q=TITLE"">Other Libraries (WorldCat)</a></li>\n<li class="yuimenuitem"><a class="yuimenuitemlabel" href="http://www.scholar.google.com/scholar?q=TITLE" target="_blank">Other Databases (Google Scholar)</a></li>\n<li class="yuimenuitem"><a class="yuimenuitemlabel" href="http://www.bookfinder.com/search/?author=AUTHOR&amp;title=TITLE&amp;st=xl&amp;ac=qr" target="_blank">Online Stores (Bookfinder.com)</a></li>','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')

View File

@ -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','<li class="yuimenuitem"><a target="_blank" class="yuimenuitemlabel" href="http://worldcat.org/search?q=TITLE"">Other Libraries (WorldCat)</a></li>\n<li class="yuimenuitem"><a class="yuimenuitemlabel" href="http://www.scholar.google.com/scholar?q=TITLE" target="_blank">Other Databases (Google Scholar)</a></li>\n<li class="yuimenuitem"><a class="yuimenuitemlabel" href="http://www.bookfinder.com/search/?author=AUTHOR&amp;title=TITLE&amp;st=xl&amp;ac=qr" target="_blank">Online Stores (Bookfinder.com)</a></li>','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

View File

@ -762,16 +762,18 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
<li style="display:none;"><a href="#" id="furthersearches">More searches</a></li>
</ul>
<!-- TMPL_IF name="OPACSearchForTitleIn" -->
<div id="furtherm" class="yuimenu">
<div class="bd">
<h4>Search for this title in:</h4>
<ul class="first-of-type">
<li class="yuimenuitem"><!-- TMPL_IF NAME="OPACURLOpenInNewWindow" --><a class="yuimenuitemlabel" href="http://worldcat.org/search?q=<!-- TMPL_VAR NAME="title" ESCAPE="url" -->" target="_blank">Other Libraries (WorldCat)</a><!-- TMPL_ELSE --><a class="yuimenuitemlabel" href="http://worldcat.org/search?q=<!-- TMPL_VAR NAME="title" ESCAPE="url" -->">Other Libraries (WorldCat)</a><!-- /TMPL_IF --></li>
<li class="yuimenuitem"><!-- TMPL_IF NAME="OPACURLOpenInNewWindow" --><a class="yuimenuitemlabel" href="http://www.scholar.google.com/scholar?q=<!-- TMPL_VAR NAME="title" ESCAPE="url" -->" target="_blank">Other Databases (Google Scholar)</a><!-- TMPL_ELSE --><a class="yuimenuitemlabel" href="http://www.scholar.google.com/scholar?q=<!-- TMPL_VAR NAME="title" ESCAPE="url" -->">Other Databases (Google Scholar)</a><!-- /TMPL_IF --></li>
<li class="yuimenuitem"><!-- TMPL_IF NAME="OPACURLOpenInNewWindow" --><a class="yuimenuitemlabel" href="http://www.bookfinder.com/search/?author=<!-- TMPL_VAR NAME="author" -->&amp;title=<!-- TMPL_VAR NAME="title" -->&amp;st=xl&amp;ac=qr" target="_blank">Online Stores (Bookfinder.com)</a><!-- TMPL_ELSE --><a class="yuimenuitemlabel" href="http://www.bookfinder.com/search/?author=<!-- TMPL_VAR NAME="author" -->&amp;title=<!-- TMPL_VAR NAME="title" -->&amp;st=xl&amp;ac=qr">Online Stores (Bookfinder.com)</a><!-- /TMPL_IF --></li>
<!-- TMPL_VAR NAME="OPACSearchForTitleIn" -->
</ul>
</div>
</div>
<!-- /TMPL_IF -->
<div id="export" class="detailtagcell">
<form method="get" action="/cgi-bin/koha/opac-export.pl">

View File

@ -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;