Koha/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tmpl
Ian Walls 90392c19cc Bug 5990: Lists and Cart show LOC code not Location Authorized value
Lists in the OPAC, and Cart on both sides, show the LOC code for items, rather
than the appropriate Description from Authorised Values.  This is because the
code uses GetItemInfo, which is a very heavy-weight call to only retrieve some
of the desired information.

This patch introduces a new subroutine in C4::Items, GetItemsLocationInfo, which
returns the branch names for both home- and holdingbranches, the location code,
both opac and intranet location descriptions, itemcallnumber and cn_sort. This
should be used instead of GetItemsInfo in any case where the locational
information is all that's required, as it's much more streamlined and efficient.

In the OPAC Lists, this only applies if OPACXSLTResultsDisplay is 'off' (set to
'normal').

Signed-off-by: Jared Camins-Esakov <jcamins@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
2011-04-01 12:07:46 +13:00

390 lines
17 KiB
Cheetah

<!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
<!-- TMPL_IF NAME="LibraryNameTitle" --><!-- TMPL_VAR NAME="LibraryNameTitle" --><!-- TMPL_ELSE -->Koha Online<!-- /TMPL_IF --> Catalog &rsaquo; Your Cart
<!-- TMPL_IF NAME="print_basket" --></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="shortcut icon" href="<!-- TMPL_VAR NAME="themelang" -->/includes/favicon.ico" type="image/x-icon" />
<meta http-equiv="Content-Language" content="en-us" />
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/jquery.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
print();
location.href="/cgi-bin/koha/opac-basket.pl?bib_list=<!-- TMPL_VAR NAME="bib_list" --><!-- TMPL_IF NAME="verbose" -->&verbose=1<!-- /TMPL_IF -->";
});
//]]>
</script>
<style type="text/css">
@import url(<!-- TMPL_VAR NAME="themelang" -->/css/print.css);
</style>
<!-- TMPL_ELSE --><!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.checkboxes.min.js"></script>
<script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function()
{
$("#itemst").tablesorter({
headers: { 0: { sorter: false },4:{sorter:false}}
});
}
);
<!-- TMPL_IF NAME="opacuserlogin" --><!-- TMPL_IF NAME="loggedinusername" --><!-- TMPL_IF NAME="TagsEnabled" -->
var MSG_NO_TAG_SPECIFIED = _("No tag was specified.");
function tagSelected() {
var bibs = document.getElementById('records').value;
if (bibs) {
$("#tagsel_tag").hide();
$("#tag_hides").hide();
$("#tagsel_form").show();
} else {
alert(MSG_NO_RECORD_SELECTED);
}
}
function tagCanceled() {
$("#tagsel_form").hide();
$("#tagsel_tag").show();
$("#tag_hides").show();
}
function tagAdded() {
var checkedBoxes = $("input:checkbox:checked");
if (!$(checkedBoxes).size()) {
alert(MSG_NO_RECORD_SELECTED);
return false;
}
var tag = $("#tagsel_new").val();
if (!tag || (tag == "")) {
alert(MSG_NO_TAG_SPECIFIED);
return false;
}
var bibs = [];
for (var i = 0; i < $(checkedBoxes).size(); i++) {
var box = $(checkedBoxes).get(i);
bibs[i] = $(box).val();
}
KOHA.Tags.add_multitags_button(bibs, tag);
return false;
}
<!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_IF -->
$(document).ready(function(){
$("#CheckAll").click(function(){
var checked = [];
$("#bookbag_form").checkCheckboxes("*", true).each(
function() {
selRecord(this.value,true);
}
);
return false;
});
$("#CheckNone").click(function(){
var checked = [];
$("#bookbag_form").unCheckCheckboxes("*",true).each(
function() {
selRecord(this.value,false);
}
);
return false;
});
<!-- TMPL_IF NAME="opacuserlogin" --><!-- TMPL_IF NAME="loggedinusername" --><!-- TMPL_IF NAME="TagsEnabled" -->
$("#tagsel_button").click(function(){
tagAdded();
return false;
});
<!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_IF -->
});
<!-- TMPL_IF NAME="opacuserlogin" --><!-- TMPL_IF NAME="RequestOnOpac" -->
function holdSel() {
var items = document.getElementById('records').value;
if (items) {
document.location = "/cgi-bin/koha/opac-reserve.pl?biblionumbers=" + items;
} else {
alert(MSG_NO_RECORD_SELECTED);
}
}
<!-- /TMPL_IF --><!-- /TMPL_IF -->
//]]>
</script>
<!-- /TMPL_IF -->
</head>
<body id="basket">
<div id="doc" class="yui-t7">
<div id="userbasket" class="container">
<h1>Your Cart</h1>
<!-- TMPL_UNLESS NAME="print_basket" -->
<div id="toolbar">
<ul>
<li><!-- TMPL_IF NAME="verbose" --><a href="opac-basket.pl" class="brief" onclick="showLess(); return false;">Brief Display</a><!-- TMPL_ELSE --><a href="opac-basket.pl" class="detail" onclick="showMore(); return false;">More Details</a><!-- /TMPL_IF --></li>
<li><a class="send" href="opac-basket.pl" onclick="sendBasket(); return false;">Send</a></li>
<li><a class="download" href="opac-basket.pl" onclick="downloadBasket(); return false;">Download</a></li>
<li><a class="print" href="opac-basket.pl" onclick="printBasket(); return false;">Print</a></li>
<li><a class="empty" href="opac-basket.pl" onclick="delBasket(); return false;">Empty and Close</a></li>
<li><a class="hide" href="opac-basket.pl" onclick="quit(); return false;">Hide Window</a></li>
</ul>
</div>
<!-- /TMPL_UNLESS -->
<!-- TMPL_IF NAME="verbose" -->
<!-- TMPL_UNLESS NAME="print_basket" --><p style="padding: 7px 0; border-top : 1px solid #E8E8E8;"><a id="CheckAll" href="#">Select All</a> <a id="CheckNone" href="#">Clear All</a> | <b>Selected items :</b>
<span id="tag_hides">
<a href="#" onclick="delSelRecords(); return false;">Remove</a>
<!-- TMPL_IF NAME="opacuserlogin" -->
<!-- TMPL_IF name="virtualshelves" --><!-- TMPL_IF NAME="loggedinusername" -->
| <a href="#" onclick="addSelToShelf(); return false;">Add to a list</a>
<!-- /TMPL_IF --><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="RequestOnOpac" -->| <a href="#" onclick="holdSel(); return false;">Place hold</a><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="loggedinusername" --><!-- TMPL_IF NAME="TagsEnabled" -->
| <a href="#" onclick="tagSelected(); return false;">Tag</a><!-- /TMPL_IF --><!-- /TMPL_IF -->
<!-- /TMPL_IF -->
</span>
<span id="tagsel_form" style="display:none">
<label for="tagsel_new" style="display:inline">New&nbsp;Tag:</label>
<input name="tagsel_new" id="tagsel_new" maxlength="100" style="display:inline"/>
<input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="tagsel_button"
type="submit" value="Add" style="display:inline" />
<a href="#" id="tagsel_cancel" onclick="tagCanceled(); return false;" style="display:inline">Cancel</a>
</span>
</p><!-- /TMPL_UNLESS -->
<form action="opac-basket.pl" method="get" name="bookbag_form" id="bookbag_form">
<!-- TMPL_LOOP NAME="BIBLIO_RESULTS" -->
<h3>
<!-- TMPL_IF NAME="print_basket" -->
<!-- TMPL_VAR NAME="title" escape="html" -->
<!-- TMPL_IF name="subtitle" --> <!-- TMPL_LOOP NAME="subtitle" --><!-- TMPL_VAR NAME="subfield" escape="html" --><!-- /TMPL_LOOP --><!-- /TMPL_IF -->
<!-- TMPL_IF name="author" --> <!-- TMPL_VAR NAME="author" escape="html" --><!-- /TMPL_IF -->
<!-- TMPL_ELSE -->
<input type="checkbox" value="<!-- TMPL_VAR NAME="biblionumber" -->" name="bib<!-- TMPL_VAR NAME="biblionumber" -->" id="bib<!-- TMPL_VAR NAME="biblionumber" -->" onclick="selRecord(value,checked)" />
<!-- TMPL_VAR NAME="title" escape="html" -->
<!-- TMPL_IF name="subtitle" --> <!-- TMPL_LOOP NAME="subtitle" --><!-- TMPL_VAR NAME="subfield" escape="html" --><!-- /TMPL_LOOP --><!-- /TMPL_IF -->
<!-- TMPL_IF name="author" --> <!-- TMPL_VAR NAME="author" escape="html"--><!-- /TMPL_IF -->
<!-- /TMPL_IF -->
</h3>
<!-- COinS / OpenURL -->
<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.au=<!-- TMPL_VAR NAME="author" -->&amp;rft.btitle=<!-- TMPL_VAR NAME="title" ESCAPE="url" -->&amp;rft.date=<!-- TMPL_VAR NAME="publicationyear" -->&amp;rft.tpages=<!-- TMPL_VAR NAME="size" -->&amp;rft.isbn=<!-- TMPL_VAR NAME="isbn" ESCAPE="url" -->&amp;rft.aucorp=&amp;rft.place=<!-- TMPL_VAR NAME="place" -->&amp;rft.pub=<!-- TMPL_VAR NAME="publisher" ESCAPE="url" -->&amp;rft.edition=<!-- TMPL_VAR NAME="edition" -->&amp;rft.series=<!-- TMPL_VAR NAME="series" -->&amp;rft.genre="></span>
<table>
<!-- TMPL_IF name="isbn" -->
<tr>
<th scope="row">ISBN</th>
<td><!-- TMPL_VAR NAME="isbn" --></td>
</tr>
<!-- /TMPL_IF -->
<!-- TMPL_IF "HASAUTHORS" -->
<tr>
<th scope="row">Author(s)</th>
<td>
<!-- TMPL_IF NAME="author" -->
<p><!-- TMPL_VAR NAME="author" --></p>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="MARCAUTHORS" -->
<!-- TMPL_LOOP NAME="MARCAUTHORS" -->
<p> <!-- TMPL_LOOP NAME="MARCAUTHOR_SUBFIELDS_LOOP" -->
<!-- TMPL_VAR NAME="separator" -->
<!-- TMPL_VAR NAME="value" -->
<!-- /TMPL_LOOP -->
</p>
<!-- /TMPL_LOOP -->
<!-- /TMPL_IF -->
</td>
</tr>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="publishercode" -->
<tr>
<th scope="row">Publisher</th>
<td><!-- TMPL_VAR NAME="place" --> <!-- TMPL_VAR NAME="publishercode" --> <!-- TMPL_VAR NAME="publicationyear" -->
</td>
</tr>
<!-- /TMPL_IF -->
<!-- TMPL_IF NAME="pages" -->
<tr>
<th scope="row">Details</th>
<td><!-- TMPL_VAR NAME="pages" --> <!-- TMPL_VAR NAME="illus" --> <!-- TMPL_VAR NAME="size" --></td>
</tr>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="seriestitle" -->
<tr>
<th scope="row">Collection</th>
<td> <!-- TMPL_VAR NAME="seriestitle" --></td>
</tr>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="MARCSUBJCTS" -->
<tr>
<th scope="row">Subject(s)</th>
<td><!-- TMPL_LOOP NAME="MARCSUBJCTS" -->
<p> <!-- TMPL_LOOP NAME="MARCSUBJECT_SUBFIELDS_LOOP" -->
<!-- TMPL_VAR NAME="separator" --><!-- TMPL_VAR NAME="value" --><!-- /TMPL_LOOP -->
</p>
<!-- /TMPL_LOOP --></td>
</tr>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="copyrightdate" -->
<tr><th scope="row">Copyright</th>
<td> <!-- TMPL_VAR NAME="copyrightdate" --></td>
</tr>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="MARCNOTES" -->
<tr>
<th scope="row">Notes</th>
<td>
<!-- TMPL_LOOP NAME="MARCNOTES" -->
<p>- <!-- TMPL_VAR NAME="marcnote" --></p>
<!-- /TMPL_LOOP --></td>
</tr>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="unititle" -->
<tr>
<th scope="row">Unified title</th>
<td> <!-- TMPL_VAR NAME="unititle" --></td>
</tr>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="serial" -->
<tr>
<th scope="row">Serial</th>
<td><!-- TMPL_VAR NAME="serial" --></td>
</tr>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="dewey" -->
<tr>
<th scope="row">Dewey</th>
<td><!-- TMPL_VAR name="dewey" --></td>
</tr>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="classification" -->
<tr>
<th scope="row">Classification</th>
<td> <!-- TMPL_VAR name="classification" --></td>
</tr>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="lccn" -->
<tr>
<th scope="row">LCCN</th>
<td> <!-- TMPL_VAR name="lccn" --></td>
</tr>
<!-- /TMPL_IF -->
<!-- TMPL_IF name="MARCURLS" -->
<tr>
<th scope="row">URL(s)</th>
<td>
<!-- TMPL_LOOP name="MARCURLS" -->
<p><!-- TMPL_IF NAME="part" --><!-- TMPL_VAR NAME="part" -->
<br /><!-- /TMPL_IF -->
<!-- TMPL_VAR NAME="MARCURL" -->
<!-- TMPL_IF NAME="notes" --><!-- TMPL_LOOP NAME="notes" --><!-- TMPL_VAR NAME="note" --><br /><!-- /TMPL_LOOP --><!-- /TMPL_IF -->
<!-- /TMPL_LOOP --></p></td>
</tr><!-- /TMPL_IF -->
<tr>
<th scope="row">Location(s)</th>
<td><!-- TMPL_IF NAME="ITEM_RESULTS" --><ul><!-- TMPL_LOOP NAME="ITEM_RESULTS" -->
<li>
<strong><!-- TMPL_VAR NAME="homebranch" --></strong><!-- TMPL_IF NAME="location_opac" -->, <!-- TMPL_VAR NAME="location_opac" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="itemcallnumber" -->
(<!-- TMPL_VAR NAME="itemcallnumber" -->)
<!-- /TMPL_IF -->
</li>
<!-- /TMPL_LOOP --></ul><!-- TMPL_ELSE -->This record has no items.<!-- /TMPL_IF --></td>
</tr>
</table>
<!-- /TMPL_LOOP -->
</form>
<!-- TMPL_ELSE -->
<!-- TMPL_UNLESS NAME="print_basket" -->
<form action="/cgi-bin/koha/opac-basket.pl" method="get" name="bookbag_form" id="bookbag_form">
<p style="border-top : 1px solid #E8E8E8;padding:5px 0;">
<a id="CheckAll" href="#">Select All</a>
<a id="CheckNone" href="#">Clear All</a>
| <b>Selected items :</b>
<span id="tag_hides">
<a href="#" onclick="delSelRecords(); return false;">Remove</a>
<!-- TMPL_IF NAME="opacuserlogin" -->
<!-- TMPL_IF NAME="virtualshelves" --><!-- TMPL_IF NAME="loggedinusername" -->
| <a href="#" onclick="addSelToShelf(); return false;">Add to a list</a>
<!-- /TMPL_IF --><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="RequestOnOpac" -->| <a href="#" onclick="holdSel(); return false;">Place hold</a><!-- /TMPL_IF -->
<!-- TMPL_IF NAME="loggedinusername" --><!-- TMPL_IF NAME="TagsEnabled" -->
| <a href="#" onclick="tagSelected(); return false;">Tag</a><!-- /TMPL_IF --><!-- /TMPL_IF -->
<!-- /TMPL_IF -->
</span>
<!-- TMPL_IF NAME="opacuserlogin" --><!-- TMPL_IF NAME="loggedinusername" --><!-- TMPL_IF NAME="TagsEnabled" --><span id="tagsel_form" style="display:none">
<label for="tagsel_new" style="display:inline">New&nbsp;Tag:</label>
<input name="tagsel_new" id="tagsel_new" maxlength="100" style="display:inline"/>
<input id="tagsel_button" name="tagsel_button" class="input tagsel_button" title="tagsel_button" type="submit" value="Add" style="display:inline"/>
<a href="#" id="tagsel_cancel" onclick="tagCanceled(); return false;" style="display:inline">Cancel</a>
</span><!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_IF -->
</p>
<!-- /TMPL_UNLESS -->
<table id="itemst">
<thead><tr>
<!-- TMPL_UNLESS NAME="print_basket" --><th>&nbsp;</th><!-- /TMPL_UNLESS -->
<th>Title</th>
<th>Author</th>
<th>Year</th>
<th>Location</th>
</tr></thead>
<!-- TMPL_LOOP NAME="BIBLIO_RESULTS" -->
<!-- TMPL_IF NAME="even" -->
<tr class="highlight">
<!-- TMPL_ELSE -->
<tr>
<!-- /TMPL_IF -->
<!-- TMPL_UNLESS NAME="print_basket" --><td>
<input type="checkbox" value="<!-- TMPL_VAR NAME="biblionumber" -->" name="bib<!-- TMPL_VAR NAME="biblionumber" -->" id="bib<!-- TMPL_VAR NAME="biblionumber" -->" onclick="selRecord(value,checked);" />
</td> <!-- /TMPL_UNLESS -->
<td>
<a href="#" onclick="openBiblio('<!-- TMPL_VAR name="dest" -->',<!-- TMPL_VAR name="biblionumber" -->)">
<!-- TMPL_VAR NAME="title" escape="html" --><!-- TMPL_IF name="subtitle" --> <!-- TMPL_LOOP NAME="subtitle" --><!-- TMPL_VAR NAME="subfield" escape="html" --><!-- /TMPL_LOOP --><!-- /TMPL_IF -->
</a>
<!-- COinS / OpenURL -->
<span class="Z3988" title="ctx_ver=Z39.88-2004&amp;rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Abook&amp;rft.au=<!-- TMPL_VAR NAME="author" -->&amp;rft.btitle=<!-- TMPL_VAR NAME="title" ESCAPE="url" -->&amp;rft.date=<!-- TMPL_VAR NAME="publicationyear" -->&amp;rft.tpages=<!-- TMPL_VAR NAME="size" -->&amp;rft.isbn=<!-- TMPL_VAR NAME="isbn" ESCAPE="url" -->&amp;rft.aucorp=&amp;rft.place=<!-- TMPL_VAR NAME="place" -->&amp;rft.pub=<!-- TMPL_VAR NAME="publisher" ESCAPE="url" -->&amp;rft.edition=<!-- TMPL_VAR NAME="edition" -->&amp;rft.series=<!-- TMPL_VAR NAME="series" -->&amp;rft.genre="></span>
<!-- TMPL_IF NAME="opacuserlogin" --><!-- TMPL_IF NAME="loggedinusername" --><!-- TMPL_IF NAME="TagsEnabled" --><div id="newtag<!-- TMPL_VAR NAME="biblionumber">_status" class="tagstatus results_summary" style="display:none">Tag status here.</div><!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_IF -->
</td>
<td><!-- TMPL_VAR NAME="author" --></td>
<td>
<!-- TMPL_IF NAME="publicationyear" -->
<!-- TMPL_VAR NAME="publicationyear" -->
<!-- TMPL_ELSE -->
<!-- TMPL_VAR NAME="copyrightdate" -->
<!-- /TMPL_IF -->
</td>
<td><!-- TMPL_IF NAME="ITEM_RESULTS" --><ul><!-- TMPL_LOOP NAME="ITEM_RESULTS" -->
<li>
<!-- TMPL_VAR NAME="homebranch" --><!-- TMPL_IF NAME="location_opac" -->, <!-- TMPL_VAR NAME="location_opac" --><!-- /TMPL_IF -->
<!-- TMPL_IF name="itemcallnumber" -->
(<!-- TMPL_VAR NAME="itemcallnumber" -->)
<!-- /TMPL_IF -->
</li>
<!-- /TMPL_LOOP --></ul><!-- TMPL_ELSE -->This record has no items.<!-- /TMPL_IF --></td>
</tr>
<!-- /TMPL_LOOP -->
</table></form>
<!-- /TMPL_IF -->
<!-- TMPL_UNLESS NAME="print_basket" -->
<form name="myform" action="opac-basket.pl" method="get">
<input type="hidden" name="records" id="records" />
</form>
<!-- /TMPL_UNLESS -->
</div>
</div>
</body>
</html>