Bug 10184 - Circulation History reverses sort order
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / readingrec.tt
index c61006b..6084357 100644 (file)
@@ -1,91 +1,86 @@
+[% USE KohaDates %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Circulation History for [% firstname %] [% surname %]</title>
+<title>Circulation History for [% INCLUDE 'patron-title.inc' %]</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() {
-       $.tablesorter.addParser({
-               id: 'articles',
-               is: function(s) {return false;  },
-               format: function(s) { return s.toLowerCase().replace(/^(the|an|a) /,''); },
-               type: 'text'
-       });
-       $.tablesorter.defaults.widgets = ['zebra'];
-       $("#table_readingrec").tablesorter({
-               sortList: [[8,1]],
-               headers: { 1: { sorter: 'articles' }}
-       }).tablesorterPager({container: $("#pagertable_readingrec"),positionFixed: false,size: 20});
-}); </script>
+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/en/css/datatables.css" />
+<script type="text/javascript" src="[% interface %]/[% theme %]/en/lib/jquery/plugins/jquery.dataTables.min.js"></script>
+[% INCLUDE 'datatables-strings.inc' %]
+<script type="text/javascript" src="[% interface %]/[% theme %]/en/js/datatables.js"></script>
+<script type="text/javascript" id="js">
+//<![CDATA[
+ $(document).ready(function() {
+    [% IF (dateformat == 'metric') %]
+        dt_add_type_uk_date();
+    [% END %]
+    $("#table_readingrec").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "sPaginationType": "four_button",
+        "aaSorting": []
+    }));
+ });
+//]]>
+</script>
 </head>
-<body>
+<body id="pat_readingrec" class="pat">
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'patron-search.inc' %]
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Circulation History for [% firstname %] [% surname %]</div>
+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; Circulation history for [% INCLUDE 'patron-title.inc' %]</div>
 
 <div id="doc3" class="yui-t2">
    
    <div id="bd">
        <div id="yui-main">
        <div class="yui-b">
-[% INCLUDE 'circ-toolbar.inc' %]
-<h1>Circulation History</h1>
+[% INCLUDE 'members-toolbar.inc' %]
+<h1>Circulation history</h1>
+[% IF loop_reading %]
 <form action="/cgi-bin/koha/members/readingrec.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" /></form>
 
-<span id="pagertable_readingrec" class="pager">
-       <form class="formpager">&nbsp;<strong>page(s)</strong>&nbsp;:
-               <img src="[% interface %]/prog/img/first.png" class="first"/>
-               <img src="[% interface %]/prog/img/prev.png" class="prev"/>
-               <input type="text" size="5" class="pagedisplay"/>
-               <img src="[% interface %]/prog/img/next.png" class="next"/>
-               <img src="[% interface %]/prog/img/last.png" class="last"/>
-               , entries/page :
-               <select class="pagesize">
-                       <option value="10">10</option>
-                       <option selected="selected" value="20">20</option>
-                       <option value="30">30</option>
-                       <option value="40">40</option>
-                       <option value="50">50</option>
-                       <option value="100">100</option>
-               </select>
-       </form>
-</span>
+
 <table id="table_readingrec">
 <thead>
     <th>Date</th>
        <th>Title</th>
        <th>Author</th>
-       <th>Call No.</th>
+    <th>Call no.</th>
        <th>Barcode</th>
-       <th>Number of Renewals</th>
+    <th>Number of renewals</th>
        <th>Checked out on</th>
        <th>Checked out from</th>
-       <th>Date Due</th>
-       <th>Return Date</th>
+    <th>Date due</th>
+    <th>Return date</th>
 </thead>
-[% FOREACH loop_readin IN loop_reading %]
-    [% IF ( loop_readin.returndate ) %]<tr>[% ELSE %]<tr class="onissue">[% END %]
+[% FOREACH issue IN loop_reading %]
+    [% IF  issue.returndate  %]<tr>[% ELSE %]<tr class="onissue">[% END %]
         <td>
-            [% loop_readin.issuestimestamp %]
+            [% issue.issuestimestamp | $KohaDates %]
         </td>
-        <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_readin.biblionumber %]">[% loop_readin.title |html %]</a></td>
+        <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% issue.biblionumber %]">[% issue.title |html %]</a></td>
 
-        <td>[% loop_readin.author %]</td>
+        <td>[% issue.author %]</td>
 
-        <td>[% loop_readin.classification %]</td>
+        <td>
+            [% IF issue.classification %]
+                [% issue.classification %]
+            [% ELSE %]
+                [% issue.itemcallnumber %]
+            [% END %]
+       </td>
 
-        <td>[% loop_readin.barcode %]</td>
+        <td>[% issue.barcode %]</td>
 
             <td>
-        [% loop_readin.renewals %]</td>
+        [% issue.renewals %]</td>
             <td>
-        [% loop_readin.issuedate %]</td>
+        [% issue.issuedate | $KohaDates %]</td>
             <td>
-        [% loop_readin.issuingbranch %]</td>
-                       <td>[% IF ( loop_readin.date_due ) %][% loop_readin.date_due %][% ELSE %]&nbsp;[% END %]</td>
+        [% issue.issuingbranch %]</td>
+                       <td>[% IF issue.date_due %]
+                    [% issue.date_due | $KohaDates %]
+                [% ELSE %]&nbsp;[% END %]</td>
             <td>
-        [% IF ( loop_readin.returndate ) %]
-            [% loop_readin.returndate %]
+        [% IF  issue.returndate %]
+            [% issue.returndate | $KohaDates %]
         [% ELSE %]
             Checked Out
         [% END %]
@@ -93,7 +88,9 @@
 </tr>
 [% END %]
 </table>
-
+[% ELSE %]
+<div class="dialog message">This patron has no circulation history.</div>
+[% END %]
 </div>
 </div>