Koha/koha-tmpl/opac-tmpl/prog/en/modules/opac-readingrecord.tt
Colin Campbell ef7ebc4ed4 Bug 8017 reduce manipulation of GetAllIssues return
GetAllIssues can produce large lists
For performance purposes:
Dont loop over the list without cause
Dont do expensive processing in the loop
Dont needlessly copy the array
Do display formatting in the template
Dont extract the barcode list unless we are producing it
Reduce db calls by using the data to hand

Make the table in the template a bit more readable
where everything was stuffed into one line

Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
2012-09-13 18:51:45 +02:00

145 lines
5.8 KiB
Text

[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %][% LibraryNameTitle or "Koha online" %] catalog &rsaquo; Your checkout history
[% INCLUDE 'doc-head-close.inc' %]
<style type="text/css">ul.ui-tabs-nav li a, ul.ui-tabs-nav li span.a { padding:0.6em 1em; }</style>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function(){
[% IF ( GoogleJackets ) %]KOHA.Google.GetCoverFromIsbn();[% END %]
$('#sortsubmit').hide();
$('#order').change(function() {
$('#sortform').submit();
});
});
//]]>
</script>
</head>
<body id="opac-readingrecord">
<div id="doc3" class="yui-t1">
<div id="bd">
[% INCLUDE 'masthead.inc' %]
<div id="yui-main">
<div class="yui-b"><div class="yui-g">
<div id="userreadingrecord" class="container">
<!--CONTENT-->
<h3><a href="/cgi-bin/koha/opac-user.pl">[% firstname %] [% surname %]'s account</a> &#8674; Checkout history</h3>
[% IF READING_RECORD.size() == 0 %]
You have never borrowed anything from this library.
[% ELSE %]
<div id="opac-user-readingrec" class="statictabs">
<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>
<ul>
[% IF ( showfulllink ) %]
[% IF ( limit ) %]
<li><a href="/cgi-bin/koha/opac-readingrecord.pl?limit=full[% IF ( orderbytitle ) %]&amp;order=title[% END %]">Show all items</a></li><li class="active"><a href="#readingrec">Showing last 50 items</a></li>
[% ELSE %]
<li class="active"><a href="/cgi-bin/koha/opac-readingrecord.pl#readingrec">Showing all items</a></li><li><a href="/cgi-bin/koha/opac-readingrecord.pl?limit=50[% IF ( orderbytitle ) %]&amp;order=title[% END %]">Show last 50 items only</a></li>
[% END %]
[% ELSE %]
<li class="active"><a href="/cgi-bin/koha/opac-readingrecord.pl#readingrec">Showing all items</a></li>
[% END %]
</ul>
<div class="tabs-container"><table id="readingrec">
<tr>
<th colspan="2">Title</th>
<th>Item type</th>
<th>Call no.</th>
<th>Date</th>
[% IF ( OPACMySummaryHTML ) %]
<th>Links</th>
[% END %]
</tr>
[% FOREACH issue IN READING_RECORD %]
[% IF loop.even %]<tr class="highlight">[% ELSE %]<tr>[% END %]
<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="http://images.amazon.com/images/P/[% issue.normalized_isbn %].01.THUMBZZZ.jpg" alt="Cover Image" /></a>
[% ELSE %]
<span class="no-image">No cover image available</span>
[% END %]
[% END %]
[% IF GoogleJackets %]
[% IF issue.normalized_isbn %]
<div style="block" 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 &amp; Taylor" src="[% BakerTaylorImageURL |html %][% issue.normalized_isbn %]" /></a>
[% ELSE %]
<span class="no-image">No cover image available</span>
[% END %]
[% END %]
[% IF SyndeticsEnabled %]
[% IF SyndeticsCoverImages %]
[% IF using_https %]
<img src="https://secure.syndetics.com/index.aspx?isbn=[% issue.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% issue.normalized_upc %]&amp;oclc=[% issue.normalized_oclc %]" alt="" class="thumbnail" />
[% ELSE %]
<img src="http://www.syndetics.com/index.aspx?isbn=[% issue.normalized_isbn %]/SC.GIF&amp;client=[% SyndeticsClientCode %]&amp;type=xw10&amp;upc=[% issue.normalized_upc %]&amp;oclc=[% issue.normalized_oclc %]" alt="" class="thumbnail" />
[% END %]
[% 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 %] [% issue.description %]</td>
<td>[% issue.itemcallnumber %]</td>
<td>
[% IF issue.returndate %]
[% issue.returndate | $KohaDates %]
[% ELSE %]
<em>(Checked out)</em>
[% END %]
</td>
[% IF OPACMySummaryHTML %]
<td>[% issue.MySummaryHTML %]</td>
[% END %]
</tr>
[% END %]
</table></div></div>
[% END %]
</div>
</div>
</div>
</div>
<div class="yui-b">
<div id="leftmenus" class="container">
[% INCLUDE 'navigation.inc' IsPatronPage=1 %]
</div>
</div>
</div>
[% INCLUDE 'opac-bottom.inc' %]