Bug 6838: Add pagination and filtering on subscriptions table
Use dataTables plugin
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Paul Poulain <paul.poulain@biblibre.com>
(cherry picked from commit 2916ddae4a)
Signed-off-by: Chris Nighswonger <chris.nighswonger@gmail.com>
This commit is contained in:
parent
4b643488f7
commit
e13db856d4
|
|
@ -608,8 +608,6 @@ sub GetSubscriptions {
|
|||
$sth = $dbh->prepare($sql);
|
||||
$sth->execute(@bind_params);
|
||||
my @results;
|
||||
my $previousbiblio = "";
|
||||
my $odd = 1;
|
||||
|
||||
while ( my $line = $sth->fetchrow_hashref ) {
|
||||
if ( $previousbiblio eq $line->{biblionumber} ) {
|
||||
|
|
|
|||
|
|
@ -1,18 +1,22 @@
|
|||
[% INCLUDE 'doc-head-open.inc' %]
|
||||
<title>Koha › Serials [% biblionumber %]</title>
|
||||
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" />
|
||||
[% INCLUDE 'doc-head-close.inc' %]
|
||||
<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
|
||||
<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() {
|
||||
$("#srlt").tablesorter({
|
||||
headers: {
|
||||
2: { sorter: false },
|
||||
4: { sorter: false },
|
||||
5: { sorter: false }
|
||||
}
|
||||
});
|
||||
});
|
||||
var srlt = $("#srlt").dataTable($.extend(true, {}, dataTablesDefaults, {
|
||||
"aoColumnDefs": [
|
||||
{ "aTargets": [ -1, -2, -3 ], "bSortable": false, "bSearchable": false },
|
||||
],
|
||||
"sPaginationType": "four_button"
|
||||
} ) );
|
||||
|
||||
srlt.fnAddFilters("filter", 750);
|
||||
});
|
||||
//]]>
|
||||
</script>
|
||||
</head>
|
||||
|
|
@ -85,16 +89,24 @@ Serials updated :
|
|||
[% IF ( routing ) %]
|
||||
<th>Routing list</th>
|
||||
[% END %]
|
||||
<th colspan="2"> </th>
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td><input type="text" class="filter" data-column_num="0" placeholder="Search ISSN" /></td>
|
||||
<td><input type="text" class="filter" data-column_num="1" placeholder="Search title" /></td>
|
||||
<td><input type="text" class="filter" data-column_num="2" placeholder="Search notes" /></td>
|
||||
<td><input type="text" class="filter" data-column_num="3" placeholder="Search library" /></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
<tbody>
|
||||
[% FOREACH subscription IN subscriptions %]
|
||||
[% UNLESS ( loop.odd ) %]
|
||||
<tr class="highlight">
|
||||
[% ELSE %]
|
||||
<tr>
|
||||
[% END %]
|
||||
<td>
|
||||
[% IF ( subscription.issn ) %][% subscription.issn %]
|
||||
[% END %]
|
||||
|
|
|
|||
Loading…
Reference in New Issue