[Koha-patches] [PATCH] bug_7647: Table sorter on issue history
Srdjan Jankovic
srdjan at catalyst.net.nz
Tue Mar 6 03:58:51 CET 2012
---
catalogue/issuehistory.pl | 4 +++
.../prog/en/modules/catalogue/issuehistory.tt | 23 +++++++++++++++++++-
2 files changed, 26 insertions(+), 1 deletions(-)
diff --git a/catalogue/issuehistory.pl b/catalogue/issuehistory.pl
index 3fb936e..88c5c9b 100755
--- a/catalogue/issuehistory.pl
+++ b/catalogue/issuehistory.pl
@@ -68,6 +68,10 @@ if ($itemnumber){
);
}
foreach (@$issues){
+ $_->{date_due_sort} = $_->{date_due};
+ $_->{issuedate_sort} = $_->{issuedate};
+ $_->{returndate_sort} = $_->{returndate};
+ $_->{lastreneweddate_sort} = $_->{lastreneweddate};
$_->{date_due} = format_date($_->{date_due});
$_->{issuedate} = format_date($_->{issuedate});
$_->{returndate} = format_date($_->{returndate});
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt
index de5db0e..3b84596 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/issuehistory.tt
@@ -1,6 +1,23 @@
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha › Catalog › Checkout History for [% title |html %]</title>
[% 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.tablesorter.pager.js"></script>
+<script type="text/javascript" id="js">
+$(document).ready(function() {
+ // call the tablesorter plugin
+ $("#table_issues").tablesorter({
+ textExtraction: function(node) {
+ var sort = node.innerHTML;
+ $(node).find(".ts_sort").each( function (idx, e) {
+ sort = e.innerHTML;
+ });
+ return sort;
+ },
+ sortList: [[4,1]]
+ }); //.tablesorterPager({container: $("#pagertable_issues"),positionFixed: false,size: 50});
+}); </script>
+
</head>
<body>
@@ -21,7 +38,7 @@
<div class="searchresults">
[% IF ( issues ) %]
<h4>Checked out [% total %] times</h4>
- <table>
+ <table id="table_issues">
<thead><tr>
<th>Patron</th>
<th>Barcode</th>
@@ -47,22 +64,26 @@
[% END %]</td>
<td>[% IF ( issue.renewals ) %]
Yes[% IF ( issue.lastreneweddate ) %], <small>last on: [% issue.lastreneweddate %]</small>
+ <span class="ts_sort" style="display: none">[% issue.lastreneweddate_sort %]</span>
[% END %]
[% ELSE %]
No
[% END %]</td>
<td>[% IF ( issue.issuedate ) %]
[% issue.issuedate %]
+ <span class="ts_sort" style="display: none">[% issue.issuedate_sort %]</span>
[% ELSE %]
[% END %]</td>
<td>[% IF ( issue.date_due ) %]
[% issue.date_due %]
+ <span class="ts_sort" style="display: none">[% issue.date_due_sort %]</span>
[% ELSE %]
[% END %]</td>
<td>[% IF ( issue.returndate ) %]
[% issue.returndate %]
+ <span class="ts_sort" style="display: none">[% issue.returndate_sort %]</span>
[% ELSE %]
[% END %]</td>
--
1.6.5
More information about the Koha-patches
mailing list