[Koha-patches] [PATCH] Bug 6838: Add pagination and filtering on subscriptions table
Julian Maurice
julian.maurice at biblibre.com
Fri Sep 2 17:01:39 CEST 2011
Use dataTables plugin
---
C4/Serials.pm | 6 ++-
.../prog/en/modules/serials/serials-home.tt | 37 ++++++++++++++------
2 files changed, 30 insertions(+), 13 deletions(-)
diff --git a/C4/Serials.pm b/C4/Serials.pm
index 8aa6ebc..51da389 100644
--- a/C4/Serials.pm
+++ b/C4/Serials.pm
@@ -613,8 +613,10 @@ sub GetSubscriptions {
while ( my $line = $sth->fetchrow_hashref ) {
if ( $previousbiblio eq $line->{biblionumber} ) {
- $line->{title} = "";
- $line->{issn} = "";
+ # Disabled for sorting and filtering on issn and title
+ # to work on serials-home.pl
+ #$line->{title} = "";
+ #$line->{issn} = "";
} else {
$previousbiblio = $line->{biblionumber};
$odd = -$odd;
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt
index 7753fd3..6fbf31f 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/serials-home.tt
@@ -1,18 +1,21 @@
[% 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>
+<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": "full_numbers"
+ } ) );
+
+ srlt.fnAddFilters("filter", 750);
+ });
//]]>
</script>
</head>
@@ -73,7 +76,7 @@ Serials updated :
[% IF ( done_searched ) %]
<h2>Serials subscriptions</h2>
- <table id="srlt">
+ <table id="srlt" class="display">
<thead>
<tr>
<th>ISSN</th>
@@ -85,9 +88,21 @@ 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 ) %]
--
1.7.5.4
More information about the Koha-patches
mailing list