+[% USE AuthorisedValues %]
+
+[% ShowCourseReserves = 0 %]
+[% IF UseCourseReserves %]
+ [% FOREACH item IN itemloop %]
+ [% IF item.course_reserves %]
+ [% FOREACH r IN item.course_reserves %]
+ [% IF r.course.enabled == 'yes' %]
+ [% ShowCourseReserves = 1 %]
+ [% END %]
+ [% END %]
+ [% END %]
+ [% END %]
+[% END %]
+
[% INCLUDE 'doc-head-open.inc' %]
[% INCLUDE 'greybox.inc' %]
<title>Koha › Catalog ›
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
<script type="text/javascript">
//<![CDATA[
+ function activate_filters(id) {
+ table = $("#" + id + " table");
+ if (table.length == 1) {
+ filters_row = table.find('thead tr.filters_row');
+ if (table.find('thead tr.columnFilter').length == 0) {
+ table.dataTable().columnFilter({
+ 'sPlaceHolder': 'head:after'
+ });
+ filters_row.addClass('columnFilter');
+ }
+ filters_row.show();
+ }
+
+ $('#' + id + '_activate_filters')
+ .text(_("Deactivate filters"))
+ .unbind('click')
+ .click(function() {
+ deactivate_filters(id);
+ return false;
+ });
+ }
+
+ function deactivate_filters(id) {
+ filters_row = $("#" + id + " table").find('thead tr.filters_row');
+
+ filters_row.find('input[type="text"]')
+ .val('') // Empty filter text boxes
+ .trigger('keyup') // Filter (display all rows)
+ .trigger('blur'); // Reset value to the column name
+ filters_row.hide();
+
+ $('#' + id + '_activate_filters')
+ .text(_("Activate filters"))
+ .unbind('click')
+ .click(function() {
+ activate_filters(id);
+ return false;
+ });
+ }
+
$(document).ready(function() {
- for (id in {holdings:0, otherholdings:0}) {
- $("#"+ id +" > table").dataTable($.extend(true, {}, dataTablesDefaults, {
+ var ids = ['holdings', 'otherholdings'];
+ for (var i in ids) {
+ var id = ids[i];
+ table = $('#' + id + ' table');
+
+ // Duplicate the table header row for columnFilter
+ thead_row = table.find('thead tr');
+ clone = thead_row.clone().addClass('filters_row');
+ thead_row.before(clone);
+
+ // Enable sorting
+ table.dataTable($.extend(true, {}, dataTablesDefaults, {
'sDom': 't',
- 'bPaginate': false
- })).columnFilter({
- 'sPlaceHolder': 'head:after'
- });
+ 'bPaginate': false,
+ 'bAutoWidth': false
+ }));
+
+ // Show a link to activate filtering
+ link = $('<a>')
+ .attr('href', '#')
+ .attr('id', id + '_activate_filters');
+ table.before(link);
+ deactivate_filters(id);
}
});
//]]>
[% BLOCK items_table %]
<table>
<thead>
- [%# duplicate the header row for columnFilter %]
- [% FOREACH i IN [1,2] %]
- <tr>
- [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
- <th>Current location</th>
- <th>Home Library</th>
- [% IF ( itemdata_ccode ) %]<th>Collection</th>[% END %]
- <th>Call number</th>
- <th>Status</th>
- <th>Last seen</th>
- <th>Barcode</th>
- [% IF ( volinfo ) %]<th>Publication details</th>[% END %]
- [% IF ( itemdata_uri ) %]<th>url</th>[% END %]
- [% IF ( itemdata_copynumber ) %]<th>Copy no.</th>[% END %]
- [% IF materials %]<th>Materials specified</th>[% END %]
- [% IF ( itemdata_itemnotes ) %]<th>Public notes</th>[% END %]
- [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine label</th>[% END %]
- [% IF ( hostrecords ) %]<th>Host records</th>[% END %]
- [% IF ( analyze ) %]<th>Used in</th><th></th>[% END %]
- </tr>
- [% END %]
+ <tr>
+ [% IF ( item_level_itypes ) %]<th>Item type</th>[% END %]
+ <th>Current location</th>
+ <th>Home library</th>
+ [% IF ( itemdata_ccode ) %]<th>Collection</th>[% END %]
+ <th>Call number</th>
+ <th>Status</th>
+ <th>Last seen</th>
+ <th>Barcode</th>
+ [% IF ( volinfo ) %]<th>Publication details</th>[% END %]
+ [% IF ( itemdata_uri ) %]<th>url</th>[% END %]
+ [% IF ( itemdata_copynumber ) %]<th>Copy no.</th>[% END %]
+ [% IF materials %]<th>Materials specified</th>[% END %]
+ [% IF ( itemdata_itemnotes ) %]<th>Public notes</th>[% END %]
+ [% IF ( SpineLabelShowPrintOnBibDetails ) %]<th>Spine label</th>[% END %]
+ [% IF ( hostrecords ) %]<th>Host records</th>[% END %]
+ [% IF ( analyze ) %]<th>Used in</th><th></th>[% END %]
+ [% IF ( ShowCourseReserves ) %]<th>Course Reserves</th>[% END %]
+ </tr>
</thead>
<tbody>
[% FOREACH item IN items %]
: due [% item.datedue %]
</span>
[% ELSIF ( item.transfertwhen ) %]
- In transit from [% item.transfertfrom %],
- to [% item.transfertto %], since [% item.transfertwhen %]
- <!-- FIXME: the "since" clause is redundant w/ lastseen field -->
+ <span class="intransit">In transit from [% itemloo.transfertfrom %] to [% itemloo.transfertto %] since [% itemloo.transfertwhen %]</span>
[% END %]
[% IF ( item.itemlost ) %]
<td><a href="/cgi-bin/koha/cataloguing/addbiblio.pl?hostbiblionumber=[% item.biblionumber %]&hostitemnumber=[% item.itemnumber %]">Create analytics</a></td>
[% END %]
+ [% IF ShowCourseReserves %]
+ <td>
+ [% IF item.course_reserves %]
+ [% FOREACH r IN item.course_reserves %]
+ [% IF r.course.enabled == 'yes' %]
+ <p>
+ <a href="/cgi-bin/koha/course_reserves/course-details.pl?course_id=[% r.course.course_id %]">
+ [% r.course.course_name %]
+ <!--[% IF r.course.course_number %] [% r.course.course_number %] [% END %]-->
+ [% IF r.course.section %] [% r.course.section %] [% END %]
+ [% IF r.course.term %] [% AuthorisedValues.GetByCode( 'TERM', r.course.term ) %] [% END %]
+ </a>
+ </p>
+ [% END %]
+ [% END %]
+ [% END %]
+ </td>
+ [% END %]
</tr>
[% END %]
</tbody>