Koha/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt
Owen Leonard ec8758aab5 Bug 9459 [Revised] Use DataTables on hold ratios report page
Replace the tablesorter plugin with the DataTables plugin on the
hold ratios report page.

To test, open the hold ratios report (Circulation -> Hold ratios).
Confirm that table sorting works correctly.

Revision adds correct pagination options and natural sort for 'items
needed' column.

Patch now depends on Bug 9431
(http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9431) which
introduces the natural sort plugin.

Further revision corrects template path to datatables assets.

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Comment: On top of Bug 9431. Sorting works. No errors.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-04-07 13:30:54 -04:00

129 lines
4.9 KiB
Text

[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Circulation &rsaquo; Hold ratios</title>
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script>
[% INCLUDE 'datatables-strings.inc' %]
<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>
<script type="text/javascript">
//<![CDATA[
$(document).ready(function() {
$("th a").hide();
$(".ratiolimit").click(function () {
$("#ratio").val($(this).html());
});
$(".ratiolimit").hover(
function () { $(this).toggleClass("ulined") },
function () { $(this).toggleClass("ulined") }
);
$("#holdst").dataTable($.extend(true, {}, dataTablesDefaults, {
"aoColumnDefs": [
{ "aTargets": [ 8 ], "sType": "natural" }
],
"aLengthMenu": [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
"iDisplayLength": 20,
"sPaginationType": "four_button"
}));
});
//]]>
</script>
<style type="text/css">
.sql { display: none; }
.ulined { text-decoration: underline; }
.ratiolimit { color: blue; cursor: pointer; }
</style>
</head>
<body id="circ_reserveratios" class="circ">
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/circ/circulation-home.pl">Circulation</a> &rsaquo; Hold ratios</div>
<div id="doc3" class="yui-t2">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<h1>Hold ratios to calculate items needed</h1>
<h3>Calculated on [% todaysdate %]. From [% from %]
to [% to %]</h3>
<p>These items have a hold ratio &ge; [% ratio %].</p>
<div class="sql">[% sql %]</div>
[% IF ( reserveloop ) %]
<table id="holdst">
<thead> <tr>
<th>Holds
<a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&amp;order=reservecount&amp;from=[% from %]&amp;to=[% to %]">Sort</a>
</th>
<th>Items
<a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&amp;order=itemcount&amp;from=[% from %]&amp;to=[% to %]">Sort</a>
</th>
<th>Hold ratio</th>
<th>Title
<a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&amp;order=biblio&amp;from=[% from %]&amp;to=[% to %]">Sort</a>
</th>
<th>Holding libraries
<a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&amp;order=branch&amp;from=[% from %]&amp;to=[% to %]">Sort</a>
</th>
<th>Location
<a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&amp;order=location&amp;from=[% from %]&amp;to=[% to %]">Sort</a>
</th>
<th>Itype
<a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&amp;order=itype&amp;from=[% from %]&amp;to=[% to %]">Sort</a>
</th>
<th>Call numbers
<a href="/cgi-bin/koha/circ/reserveratios.pl?ratio=[% ratio %]&amp;order=callnumber&amp;from=[% from %]&amp;to=[% to %]">Sort</a>
</th>
<th>Items needed
</th>
</tr></thead>
<tbody>[% FOREACH reserveloo IN reserveloop %]
<tr>
<td><p>[% reserveloo.reservecount %]</p></td>
<td><p>[% reserveloo.itemcount %]</p></td>
<td><p class="ratiolimit">[% reserveloo.thisratio %]</p></td>
<td> [% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %][% reserveloo.title |html %] [% IF ( reserveloo.subtitle ) %][% FOREACH subtitl IN reserveloo.subtitle %][% subtitl.subfield %][% END %][% END %]</a>[% IF ( reserveloo.author ) %] by [% reserveloo.author %][% END %]
</td>
<td><p>[% reserveloo.listbranch %]</p></td>
<td><p>[% reserveloo.location %]</p></td>
<td><p>[% reserveloo.itype %]</p></td>
<td><p>[% reserveloo.listcall %]</p></td>
<td>[% IF ( reserveloo.thisratio_atleast1 ) %]<p><b>[% reserveloo.ratiocalc %] to order</b></p>[% END %]</td>
</tr>
[% END %]</tbody>
</table>
[% ELSE %]
<b>No items found.</b>
[% END %]
</div>
</div>
<div class="yui-b">
<form action="/cgi-bin/koha/circ/reserveratios.pl" method="post" >
<fieldset class="brief">
<h4>Refine results:</h4>
<ol><li><label for="ratio">
Hold ratio:
</label>
<input type="text" size="5" id="ratio" name="ratio" value="[% ratio %]" /></li>
<li><label for="from">
Start date:
</label>
<input type="text" size="10" id="from" name="from" value="[% from %]" class="datepickerfrom" />
</li>
<li><label for="to">
End date:
</label>
<input size="10" id="to" name="to" value="[% to %]" type="text" class="datepickerto" />
</li></ol>
(inclusive)
<fieldset class="action"><input type="submit" value="Go" class="submit"/></fieldset>
</fieldset>
</form>
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]