Fix for Bug 4997, More searches menu not on OPAC MARC and ISBD detail pages

Signed-off-by: Nicole Engard <nengard@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
This commit is contained in:
Owen Leonard 2010-12-15 21:33:59 -05:00 committed by Chris Cormack
parent 324991fefd
commit 402240bbe2
4 changed files with 82 additions and 1 deletions

View File

@ -5,6 +5,20 @@
$(document).ready(function() {
$('#bibliodescriptions > ul').tabs();
});
YAHOO.util.Event.onContentReady("furtherm", function () {
$("#furtherm").css("display","block").css("visibility","hidden");
$("#furthersearches").parent().show();
var furthersearchesMenu = new YAHOO.widget.Menu("furtherm");
furthersearchesMenu.render();
furthersearchesMenu.cfg.setProperty("context", ["furthersearches", "tr", "br"]);
furthersearchesMenu.subscribe("beforeShow",positionfurthersearchesMenu);
furthersearchesMenu.subscribe("show", furthersearchesMenu.focus);
function positionfurthersearchesMenu() {
furthersearchesMenu.align("tr", "br");
}
YAHOO.util.Event.addListener("furthersearches", "click", furthersearchesMenu.show, null, furthersearchesMenu);
YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionfurthersearchesMenu);
});
//]]>
</script>
<!-- TMPL_IF NAME="OPACXSLTDetailsDisplay" --><script type="text/javascript">
@ -71,8 +85,22 @@
<!-- TMPL_IF NAME="opacbookbag" --><li><a class="addtocart" href="#" onclick="addRecord('<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">
Add to Your Cart
</a></li><!-- /TMPL_IF -->
<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">
<!-- TMPL_VAR NAME="OPACSearchForTitleIn" -->
</ul>
</div>
</div>
<!-- /TMPL_IF -->
<div id="export">
<form method="get" action="/cgi-bin/koha/opac-export.pl">
<label for="format">Save Record:</label>

View File

@ -1,8 +1,27 @@
<!-- TMPL_INCLUDE NAME="doc-head-open.inc" --><!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog &rsaquo; MARC Details for Record No. <!-- TMPL_VAR name="biblionumber" -->
<!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<!-- TMPL_IF NAME="OPACXSLTDetailsDisplay" --><script type="text/javascript">
<script type="text/javascript">
//<![CDATA[
YAHOO.util.Event.onContentReady("furtherm", function () {
$("#furtherm").css("display","block").css("visibility","hidden");
$("#furthersearches").parent().show();
var furthersearchesMenu = new YAHOO.widget.Menu("furtherm");
furthersearchesMenu.render();
furthersearchesMenu.cfg.setProperty("context", ["furthersearches", "tr", "br"]);
furthersearchesMenu.subscribe("beforeShow",positionfurthersearchesMenu);
furthersearchesMenu.subscribe("show", furthersearchesMenu.focus);
function positionfurthersearchesMenu() {
furthersearchesMenu.align("tr", "br");
}
YAHOO.util.Event.addListener("furthersearches", "click", furthersearchesMenu.show, null, furthersearchesMenu);
YAHOO.widget.Overlay.windowResizeEvent.subscribe(positionfurthersearchesMenu);
});
<!-- TMPL_IF NAME="OPACXSLTDetailsDisplay" -->
var GB_ROOT_DIR = "/opac-tmpl/prog/en/lib/greybox/";
<!-- /TMPL_IF -->
//]]>
</script>
<!-- TMPL_IF NAME="OPACXSLTDetailsDisplay" -->
<script type="text/javascript" src="/opac-tmpl/prog/en/lib/greybox/AJS.js"></script>
<script type="text/javascript" src="/opac-tmpl/prog/en/lib/greybox/AJS_fx.js"></script>
<script type="text/javascript" src="/opac-tmpl/prog/en/lib/greybox/gb_scripts.js"></script>
@ -188,8 +207,22 @@
<!-- TMPL_IF NAME="opacbookbag" --><li><a class="addtocart" href="#" onclick="addRecord('<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">
Add to Your Cart
</a></li><!-- /TMPL_IF -->
<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">
<!-- TMPL_VAR NAME="OPACSearchForTitleIn" -->
</ul>
</div>
</div>
<!-- /TMPL_IF -->
<div id="export">
<form method="get" action="/cgi-bin/koha/opac-export.pl">
<label for="format">Save Record:</label>

View File

@ -155,6 +155,16 @@ $template->param(
reviews => $reviews,
);
#Search for title in links
if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){
$dat->{author} ? $search_for_title =~ s/{AUTHOR}/$dat->{author}/g : $search_for_title =~ s/{AUTHOR}//g;
$dat->{title} =~ s/\/+$//; # remove trailing slash
$dat->{title} =~ s/\s+$//; # remove trailing space
$dat->{title} ? $search_for_title =~ s/{TITLE}/$dat->{title}/g : $search_for_title =~ s/{TITLE}//g;
$isbn ? $search_for_title =~ s/{ISBN}/$isbn/g : $search_for_title =~ s/{ISBN}//g;
$template->param('OPACSearchForTitleIn' => $search_for_title);
}
## Amazon.com stuff
#not used unless preference set
if ( C4::Context->preference("OPACAmazonEnabled") == 1 ) {

View File

@ -269,6 +269,16 @@ if(C4::Context->preference("ISBD")) {
$template->param(ISBD => 1);
}
#Search for title in links
if (my $search_for_title = C4::Context->preference('OPACSearchForTitleIn')){
$biblio->{author} ? $search_for_title =~ s/{AUTHOR}/$biblio->{author}/g : $search_for_title =~ s/{AUTHOR}//g;
$biblio->{title} =~ s/\/+$//; # remove trailing slash
$biblio->{title} =~ s/\s+$//; # remove trailing space
$biblio->{title} ? $search_for_title =~ s/{TITLE}/$biblio->{title}/g : $search_for_title =~ s/{TITLE}//g;
$biblio->{isbn} ? $search_for_title =~ s/{ISBN}/$biblio->{isbn}/g : $search_for_title =~ s/{ISBN}//g;
$template->param('OPACSearchForTitleIn' => $search_for_title);
}
$template->param(
item_loop => \@item_value_loop,
item_header_loop => \@header_value_loop,