Owen Leonard
535a224b87
This follow-up makes a few changes to the template: 1. The "show all" / "show 50" links have been modified to show the current state. 2. The tabs are only shown if the OnSiteCheckouts preference is turned on. 3. The DataTables configuration has been modified so that title sorting ignores articles, sorting on the the first column is disabled, and sorting by date works regardless of your dateformat preference. 4. Some indentation has been corrected and markup comments added. To test the opacreadinghistory preference must be enabled. Log in to the OPAC as a patron who has some on-site checkouts as well as regular checkouts. With OnSiteCheckouts enabled, view the reading history page and confirm that the tabs work correctly. Test the table sorting controls. With OnSiteCheckouts disabled, confirm that the tabs do not appear. Test the "Show all items"/"Show last 50 items" links and confirm that the behavior is correct. Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Works as described, passes tests and QA script. Good addition to the new on-site feature. Note: It would be nice to show the 'on-site' note also in the liste of checkouts on the summary page! Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
206 lines
13 KiB
Text
206 lines
13 KiB
Text
[% USE Koha %]
|
|
[% USE KohaDates %]
|
|
[% INCLUDE 'doc-head-open.inc' %]
|
|
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your checkout history
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
[% BLOCK cssinclude %]
|
|
<style type="text/css">ul.ui-tabs-nav li a, ul.ui-tabs-nav li span.a { padding:0.6em 1em; }</style>
|
|
[% END %]
|
|
</head>
|
|
[% INCLUDE 'bodytag.inc' bodyid='opac-readingrecord' %]
|
|
[% INCLUDE 'masthead.inc' %]
|
|
|
|
<div class="main">
|
|
<ul class="breadcrumb">
|
|
<li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li>
|
|
<li><a href="/cgi-bin/koha/opac-user.pl">[% firstname %] [% surname %]</a> <span class="divider">›</span></li>
|
|
<li><a href="#">Your checkout history</a></li>
|
|
</ul>
|
|
|
|
<div class="container-fluid">
|
|
<div class="row-fluid">
|
|
<div class="span2">
|
|
<div id="navigation">
|
|
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
|
|
</div>
|
|
</div>
|
|
<div class="span10">
|
|
<div id="userreadingrecord">
|
|
<h3>Checkout history</h3>
|
|
|
|
[% IF READING_RECORD.size == 0 %]
|
|
You have never borrowed anything from this library.
|
|
[% ELSE %]
|
|
<div id="opac-user-readingrec">
|
|
<div class="resultscontrol resort">
|
|
<form id="sortform" action="/cgi-bin/koha/opac-readingrecord.pl" method="get">
|
|
[% UNLESS ( limit ) %]<input type="hidden" name="limit" value="full" />[% END %]
|
|
<select name="order" id="order">
|
|
[% IF ( orderbydate ) %]<option value="" selected="selected">Order by date</option>[% ELSE %]<option value="">Order by date</option>[% END %]
|
|
[% IF ( orderbytitle ) %]<option value="title" selected="selected">Order by title</option>[% ELSE %]<option value="title">Order by title</option>[% END %]
|
|
</select>
|
|
<input type="submit" value="Go" id="sortsubmit" class="submit clearfix" />
|
|
</form>
|
|
</div>
|
|
|
|
[% IF limit %]
|
|
<p>
|
|
Showing last 50 items. <a href="/cgi-bin/koha/opac-readingrecord.pl?limit=full[% IF ( orderbytitle ) %]&order=title[% END %]">Show all items</a>
|
|
</p>
|
|
[% ELSE %]
|
|
<p>
|
|
Showing all items. <a href="/cgi-bin/koha/opac-readingrecord.pl?limit=50[% IF ( orderbytitle ) %]&order=title[% END %]">Show last 50 items</a>
|
|
</p>
|
|
[% END %]
|
|
|
|
[% IF Koha.Preference( 'OnSiteCheckouts' ) == 1 %]
|
|
<div id="tabs" class="toptabs">
|
|
<ul>
|
|
<li><a href="#tabs-container" id="tab_all">All</a></li>
|
|
<li><a href="#tabs-container" id="tab_checkout">Checkouts</a></li>
|
|
<li><a href="#tabs-container" id="tab_onsite_checkout">On-site checkouts</a></li>
|
|
</ul>
|
|
[% END %]
|
|
<div id="tabs-container" style="overflow:hidden">
|
|
<table id="readingrec" class="table table-bordered table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th style="display:none;">Type</th>
|
|
<th class="nosort"></th>
|
|
<th class="anti-the">Title</th>
|
|
<th>Item type</th>
|
|
<th>Call no.</th>
|
|
<th class="title-string">Date</th>
|
|
[% IF ( OPACMySummaryHTML ) %]
|
|
<th>Links</th>
|
|
[% END %]
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
[% FOREACH issue IN READING_RECORD %]
|
|
<tr>
|
|
<td style="display:none;">
|
|
[% IF issue.onsite_checkout %]
|
|
onsite
|
|
[% ELSE %]
|
|
checkout
|
|
[% END %]
|
|
</td>
|
|
<td>
|
|
[% IF OPACAmazonCoverImages %]
|
|
[% IF issue.normalized_isbn %]
|
|
<a href="http://www.amazon.com/gp/reader/[% issue.normalized_isbn %]/ref=sib_dp_pt/002-7879865-0184864#reader-link"><img border="0" src="https://images-na.ssl-images-amazon.com/images/P/[% issue.normalized_isbn %].01.THUMBZZZ.jpg" alt="" class="item-thumbnail" /></a>
|
|
[% ELSE %]
|
|
<span class="no-image">No cover image available</span>
|
|
[% END %]
|
|
[% END %]
|
|
|
|
[% IF GoogleJackets %]
|
|
[% IF issue.normalized_isbn %]
|
|
<div title="[% issue.biblionumber |url %]" class="[% issue.normalized_isbn %]" id="gbs-thumbnail[% loop.count %]"></div>
|
|
[% ELSE %]
|
|
<span class="no-image">No cover image available</span>
|
|
[% END %]
|
|
[% END %]
|
|
|
|
[% IF BakerTaylorEnabled %]
|
|
[% IF issue.normalized_isbn %]
|
|
<a href="https://[% BakerTaylorBookstoreURL |html %][% issue.normalized_isbn %]"><img alt="See Baker & Taylor" src="[% BakerTaylorImageURL |html %][% issue.normalized_isbn %]" /></a>
|
|
[% ELSE %]
|
|
<span class="no-image">No cover image available</span>
|
|
[% END %]
|
|
[% END %]
|
|
|
|
[% IF SyndeticsEnabled && SyndeticsCoverImages %]
|
|
[% IF using_https %]
|
|
<img src="https://secure.syndetics.com/index.aspx?isbn=[% issue.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% issue.normalized_upc %]&oclc=[% issue.normalized_oclc %]" alt="" class="item-thumbnail" />
|
|
[% ELSE %]
|
|
<img src="http://www.syndetics.com/index.aspx?isbn=[% issue.normalized_isbn %]/SC.GIF&client=[% SyndeticsClientCode %]&type=xw10&upc=[% issue.normalized_upc %]&oclc=[% issue.normalized_oclc %]" alt="" class="item-thumbnail" />
|
|
[% END %]
|
|
[% END %]
|
|
</td>
|
|
<td>
|
|
[% IF issue.BiblioDefaultViewmarc %]
|
|
<a class="title" href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% issue.biblionumber |url %]">[% issue.title |html %] [% IF issue.subtitle %][% FOREACH subtitl IN issue.subtitle %][% subtitl.subfield %][% END %][% END %]</a>
|
|
[% ELSIF issue.BiblioDefaultViewisbd %]
|
|
<a class="title" href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% issue.biblionumber |url %]">[% issue.title |html %] [% IF issue.subtitle %][% FOREACH subtitl IN issue.subtitle %][% subtitl.subfield %][% END %][% END %]</a>
|
|
[% ELSE %]
|
|
<a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% issue.biblionumber |url %]">[% issue.title |html %] [% IF issue.subtitle %][% FOREACH subtitl IN issue.subtitle %][% subtitl.subfield %][% END %][% END %]</a>
|
|
[% END %]
|
|
<span class="item-details">[% issue.author %]</span>
|
|
</td>
|
|
<td>
|
|
[% UNLESS ( noItemTypeImages ) %]
|
|
[% IF ( issue.imageurl ) %]
|
|
<img src="[% issue.imageurl %]" alt="" />
|
|
[% END %]
|
|
[% END %]
|
|
<span class="tdlabel">Item type:</span>
|
|
[% issue.description %]</td>
|
|
<td>
|
|
<span class="tdlabel">Call number:</span>
|
|
[% issue.itemcallnumber %]
|
|
</td>
|
|
<td>
|
|
[% IF issue.returndate %]
|
|
<span class="tdlabel">Check-in date:</span>
|
|
<span title="[% issue.returndate %]">[% issue.returndate | $KohaDates %]</span>
|
|
[% ELSE %]
|
|
<span title="Checked out"><em>(Checked out)</em></span>
|
|
[% END %]
|
|
</td>
|
|
[% IF OPACMySummaryHTML %]
|
|
<td>[% issue.MySummaryHTML %]</td>
|
|
[% END %]
|
|
</tr>
|
|
[% END # / FOREACH issue %]
|
|
</tbody>
|
|
</table>
|
|
</div> <!-- / .tabs-container -->
|
|
[% IF ( Koha.Preference( 'OnSiteCheckouts' ) == 1 ) %]
|
|
</div> <!-- /#tabs -->
|
|
[% END %]
|
|
</div> <!-- / .opac-user-readingrec -->
|
|
[% END # / IF READING_RECORD.size %]
|
|
</div> <!-- / .userreadingrecord -->
|
|
</div> <!-- / .span10 -->
|
|
</div> <!-- / .row-fluid -->
|
|
</div> <!-- / .container-fluid -->
|
|
</div> <!-- / .main -->
|
|
|
|
[% INCLUDE 'opac-bottom.inc' %]
|
|
[% BLOCK jsinclude %]
|
|
[% INCLUDE 'datatables.inc' %]
|
|
<script type="text/javascript">
|
|
//<![CDATA[
|
|
$(document).ready(function(){
|
|
[% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
|
|
$('#sortsubmit').hide();
|
|
$('#order').change(function() {
|
|
$('#sortform').submit();
|
|
});
|
|
|
|
var table = $("#readingrec").dataTable($.extend(true, {}, dataTablesDefaults, {
|
|
"sPaginationType": "four_button",
|
|
"aoColumnDefs": [
|
|
{ "aTargets": [ "nosort" ],"bSortable": false,"bSearchable": false },
|
|
{ "sType": "anti-the", "aTargets" : [ "anti-the" ] },
|
|
{ "sType": "title-string", "aTargets" : [ "title-string" ] }
|
|
]
|
|
}));
|
|
var tabs = $("#tabs").tabs({
|
|
select: function(e, ui) {
|
|
var id = $(ui.tab).attr("id");
|
|
if ( id == "tab_checkout" ) {
|
|
table.fnFilter("checkout", 0);
|
|
} else if ( id == "tab_onsite_checkout" ) {
|
|
table.fnFilter("onsite", 0);
|
|
} else { // all
|
|
table.fnFilter('', 0);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
//]]>
|
|
</script>
|
|
[% END %]
|