Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-course-details.tt
Jonathan Druart dadfeabc37 Bug 18276: Remove GetBiblioFromItemNumber - Course reserves
Values from the items, biblio and biblioitems tables are used in the template,
so we need to pass all of them to the template, but separately.
That way we easily see which field from which table we are displaying.

Test plan:
Create a course reserve and add items.
Correct information must be displayed on the detail page of the course
reserve, on staff and OPAC interface.

Signed-off-by: Josef Moravec <josef.moravec@gmail.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2017-07-10 12:09:24 -03:00

118 lines
6.1 KiB
Text

[% USE Koha %]
[% USE KohaDates %]
[% USE AuthorisedValues %]
[% USE ItemTypes %]
[% USE Branches %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Course reserves for [% course.course_name %]</title>
[% INCLUDE 'doc-head-close.inc' %]
[% BLOCK cssinclude %]
<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
[% END %]
</head>
[% INCLUDE 'bodytag.inc' bodyid='opac-main' %]
[% INCLUDE 'masthead.inc' %]
<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-course-reserves.pl">Course reserves</a> <span class="divider">&rsaquo;</span></li>
<li><a href="#">Course reserves for <i>[% course.course_name %]</i></a></li>
</ul>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<h2>Course reserves for <i>[% course.course_name %]</i></h2>
<div class="rows">
<ol>
[% IF ( course.term ) %]<li><span class="label">Term:</span> [% AuthorisedValues.GetByCode( 'TERM', course.term ) %]</li>[% END %]
<li><span class="label">Department:</span> [% AuthorisedValues.GetByCode( 'DEPARTMENT', course.department ) %]</li>
[% IF ( course.course_number ) %]<li><span class="label">Course number:</span> [% course.course_number %]</li>[% END %]
[% IF ( course.section ) %]<li><span class="label">Section:</span> [% course.section %]</li>[% END %]
[% IF ( course.instructors ) %]
<li><span class="label">Instructors:</span>
<ul>
[% FOREACH i IN course.instructors %]
<li><div class="instructor">[% i.firstname %] [% i.surname %]</div></li>
[% END %]
</ul>
</li>
[% END %]
[% IF ( course.public_note ) %]<li><span class="label">Notes:</span> [% course.public_note %]</li>[% END %]
</ol>
</div>
[% IF ( course_reserves ) %]
<table id="course-items-table" class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th class="anti-the">Title</th>
<th>Author</th>
<th>Item type</th>
<th>Location</th>
<th>Collection</th>
<th>Call number</th>
<th>Copy number</th>
<th>Status</th>
<th class="title-string">Date due</th>
<th>Notes</th>
<th>Link</th>
</tr>
</thead>
<tbody>
[% FOREACH cr IN course_reserves %]
<tr>
<td><a href="opac-detail.pl?biblionumber=[% cr.biblio.biblionumber %]">[% cr.biblio.title %]</a></td>
<td>[% cr.biblio.author %]</td>
<td>[% ItemTypes.GetDescription( cr.item.itype ) %]</td>
<td>[% Branches.GetName( cr.item.holdingbranch ) %] <br/> <i>[% AuthorisedValues.GetByCode( 'LOC', cr.item.location ) %]</i></td>
<td>[% AuthorisedValues.GetByCode( 'CCODE', cr.item.ccode ) %]</td>
<td>[% cr.item.itemcallnumber %]</td>
<td>[% cr.item.copynumber %]</td>
<td>[% INCLUDE 'item-status.inc' item=cr.item issue=cr.issue %]</td>
<td><span title="[% cr.issue.date_due %]">[% cr.issue.date_due | $KohaDates as_due_date => 1 %]</span></td>
<td>[% IF ( cr.public_note ) %]
[% cr.public_note %]
[% ELSIF ( cr.item.itemnotes ) %]
[% cr.item.itemnotes %]
[% END %]
</td>
<td>[% IF (cr.item.uri) %]
<a href="[% cr.item.uri %]">Item URI</a>
[% ELSIF (cr.biblioitem.url) %]
<a href="[% cr.biblioitem.url %]">Record URL</a>
[% END %]
</td>
</tr>
[% END %]
</tbody>
</table>
[% ELSE %]
<br style="clear:both;" />
<div class="alert alert-info">
<p>No reserves have been selected for this course.</p>
</div>
[% END %]
</div> <!-- / .span12 -->
</div> <!-- / .row-fluid -->
</div> <!-- / .container-fluid -->
</div> <!-- / .main -->
[% INCLUDE 'opac-bottom.inc' %]
[% BLOCK jsinclude %]
[% INCLUDE 'datatables.inc' %]
<script type="text/javascript">
$(document).ready(function() {
$("#course-items-table").dataTable($.extend(true, {}, dataTablesDefaults, {
"sDom": '<"top"flp>rt<"clear">',
"aoColumnDefs": [
{ "sType": "anti-the", "aTargets" : [ "anti-the" ] },
{ "sType": "title-string", "aTargets" : [ "title-string" ] }
]
}));
});
</script>
[% END %]