Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-readingrecord.tt
Martin Persson 6e82493b65 Bug 8630: Adlibris covers (OPAC templates)
Changes to OPAC templates.
Depends on new CSS clases defined in separate patch.

Test plan:

To test this particular patch (intranet templates) you need:
* The syspref patch applied
* The intranet CSS patch applied

To test:
* Apply this patch

* Enable covers (if not done already)
  * Go to staff interface, log in as a priviliged user.
  * Select "More" -> "Administration" ->
	"Global system preferences" -> "Enhanced content".
  * Set ""AdlibrisCoversEnabled" to "Show" under "Adlibris".
  * Save changes

* Add a book with a known cover/ISBN (if none exists)
  * Set MARC field 020 a,
	"INTERNATIONAL STANDARD BOOK NUMBER" to: 9780451524935
  * Set MARC field 245 a, "Title" to: 1984
  * Save changes

* Test opac-results.tt
  * Search library catalog from OPAC for "1984".
  * You should be sent to:
    http://127.0.1.1/cgi-bin/koha/opac-search.pl?idx=&q=1984
  * Cover image should be shown to the right of each title
    with CSS class: "adlibris-cover"

* Test opac-detail.tt
  (continued from previous test's location)
  * Click on the title with cover (1984, ISBN: 9780451524935)
  * Cover should be displayed to the left in full size.
  * If clicked, should link to the full-size image.

Test opac-results-grouped.tt
  * This template is only used if an external "grouping" server is
    setup and the syspref "OPACGroupResults" is set to "Use".
  * Personally I did not test this, b/c: terminally lazy

* Test opac-showreviews.tt
  * Could not find any links to this location, manually enter it:
    http://127.0.1.1/cgi-bin/koha/opac-showreviews.pl
  * Image should be shown to the right in full size.
  * If clicked it should take you to the detail view with the
    comments tab opened.

* Test opac-showreviews-rss.tt
  * Click on the RSS icon from previous test's start location.
    URL should be:
    http://127.0.1.1/cgi-bin/koha/opac-showreviews.pl?format=rss
  * An image tag linking to the full-size image without any
    styling class should be present.

* Test opac-user.tt
  * Click on your username to open:
    http://127.0.1.1/cgi-bin/koha/opac-user.pl
  * Covers should be shown for checked out items with
    CSS class: adlibris-cover
  * When clicked the destination should be the same as
    clicking the title column entry: opac-details.pl

* Test opac-opensearch.tt
  * Click on "Advanced search" and enter "1984" then press "Search"
  * This search screen uses a different template.
  * Cover image should be shown to the right of each title
    with CSS class: "adlibris-cover"
  * If clicked, should link to the OPAC detail view.

* Test opac-readingrecord.tt
  * Click on your logged-in name to go to your personal page.
  * Click on "Your reading history" tab on the left.
    http://127.0.1.1/cgi-bin/koha/opac-readingrecord.pl
  * Covers should be shown in leftmost column with
    CSS class: adlibris-cover
  * If clicked, should link to the same as the 'Title' link.

Sponsored-By: Halland County Library

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2018-11-05 14:41:06 +00:00

222 lines
15 KiB
Text

[% USE raw %]
[% USE Koha %]
[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your checkout history</title>
[% INCLUDE 'doc-head-close.inc' %]
[% BLOCK cssinclude %]
<style>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' %]
[% SET AdlibrisEnabled = Koha.Preference('AdlibrisCoversEnabled') %]
[% SET AdlibrisURL = Koha.Preference('AdlibrisCoversURL') %]
[% IF Koha.Preference('AmazonAssocTag') %]
[% AmazonAssocTag = '?tag=' _ Koha.Preference('AmazonAssocTag') %]
[% ELSE %]
[% AmazonAssocTag = '' %]
[% END %]
<div class="main">
<ul class="breadcrumb">
<li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
<li><a href="/cgi-bin/koha/opac-user.pl">[% INCLUDE 'patron-title.inc' patron = logged_in_user %]</a> <span class="divider">&rsaquo;</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 %]
[% IF ( orderbyauthor ) %]<option value="author" selected="selected">Order by author</option>[% ELSE %]<option value="author">Order by author</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 ) %]&amp;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 ) %]&amp;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 %][% issuetype = 'onsite_checkout' %]
[% ELSE %][% issuetype = 'standard_checkout' %]
[% END %]
[% issuetype | html %]
</td>
<td>
[% IF ( AdlibrisEnabled && issue.normalized_isbn ) %]
[% IF issue.BiblioDefaultViewmarc %]
<a href="/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=[% issue.biblionumber |url %]">
[% ELSIF issue.BiblioDefaultViewisbd %]
<a href="/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=[% issue.biblionumber |url %]">
[% ELSE %]
<a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% issue.biblionumber |url %]">
[% END %]
<img src="[% AdlibrisURL | html %]?isbn=[% issue.normalized_isbn | html %]" class="adlibris-cover" alt="Adlibris cover image" /></a>
[% END %]
[% IF OPACAmazonCoverImages %]
[% IF issue.normalized_isbn %]
<a href="http://www.amazon.com/gp/reader/[% issue.normalized_isbn | uri %][% AmazonAssocTag | uri %]#reader-link"><img border="0" src="https://images-na.ssl-images-amazon.com/images/P/[% issue.normalized_isbn | html %].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 | html %]" id="gbs-thumbnail[% loop.count | html %]"></div>
[% ELSE %]
<span class="no-image">No cover image available</span>
[% END %]
[% END %]
[% IF BakerTaylorEnabled %]
[% bt_id = ( issue.normalized_upc || issue.normalized_isbn ) %]
[% IF ( bt_id ) %]
<a href="https://[% BakerTaylorBookstoreURL | uri %][% bt_id | uri %]"><img alt="See Baker &amp; Taylor" src="[% BakerTaylorImageURL | html %][% bt_id | html %]" /></a>
[% ELSE %]
<span class="no-image">No cover image available</span>
[% END %]
[% END %]
[% IF SyndeticsEnabled && SyndeticsCoverImages %]
<img src="https://secure.syndetics.com/index.aspx?isbn=[% issue.normalized_isbn | html %]/SC.GIF&amp;client=[% SyndeticsClientCode | html %]&amp;type=xw10&amp;upc=[% issue.normalized_upc | html %]&amp;oclc=[% issue.normalized_oclc | html %]" alt="" class="item-thumbnail" />
[% 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 | html %][% 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 | html %][% 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 | html %][% END %][% END %]</a>
[% END %]
<span class="item-details">[% issue.author | html %]</span>
</td>
<td>
[% UNLESS ( noItemTypeImages ) %]
[% IF ( issue.imageurl ) %]
<img src="[% issue.imageurl | html %]" alt="" />
[% END %]
[% END %]
<span class="tdlabel">Item type:</span>
[% issue.translated_description | html %]</td>
<td>
<span class="tdlabel">Call number:</span>
[% issue.itemcallnumber | html %]
</td>
<td>
[% IF issue.returndate %]
<span class="tdlabel">Check-in date:</span>
<span title="[% issue.returndate | html %]">[% issue.returndate | $KohaDates %]</span>
[% ELSE %]
<span title="Checked out"><em>(Checked out)</em></span>
[% END %]
</td>
[% IF OPACMySummaryHTML %]
<td>[% issue.MySummaryHTML | $raw %]</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>
//<![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",
"columnDefs": [
{ "targets": [ "nosort" ],"sortable": false,"searchable": false },
{ "type": "anti-the", "targets" : [ "anti-the" ] },
{ "type": "title-string", "targets" : [ "title-string" ] }
]
}));
var tabs = $("#tabs").tabs({
select: function(e, ui) {
var id = $(ui.tab).attr("id");
if ( id == "tab_checkout" ) {
table.fnFilter("standard_checkout", 0);
} else if ( id == "tab_onsite_checkout" ) {
table.fnFilter("onsite_checkout", 0);
} else { // all
table.fnFilter('', 0);
}
}
});
});
//]]>
</script>
[% END %]