Bug 17434: Moremember displaying primary and secondary phone number twice
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / readingrec.tt
index f1554f0..5f2e1d8 100644 (file)
+[% USE KohaDates %]
+[% USE Koha %]
+[% USE AuthorisedValues %]
+[% USE Branches %]
 [% INCLUDE 'doc-head-open.inc' %]
 <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({[% IF ( dateformat_metric ) %]
-               dateFormat: 'uk',[% END %]
-               sortList: [[8,1]],
-               headers: { 1: { sorter: 'articles' }, 9: { sorter: 'shortDate'} }
-       }).tablesorterPager({container: $("#pagertable_readingrec"),positionFixed: false,size: 20});
-}); </script>
+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
+[% INCLUDE 'datatables.inc' %]
+<script type="text/javascript" id="js">
+//<![CDATA[
+
+ $(document).ready(function() {
+    var table = $("#table_readingrec").dataTable($.extend(true, {}, dataTablesDefaults, {
+        "sPaginationType": "four_button",
+        "aaSorting": [],
+        "aoColumnDefs": [
+            { "sType": "anti-the", "aTargets" : [ "anti-the" ] },
+            { "sType": "title-string", "aTargets" : [ "title-string" ] }
+        ]
+    }));
+    var tabs = $("#tabs").tabs({
+        activate: function(e, ui) {
+            var active = tabs.tabs("option", "active" );
+            if ( active == 1 ) {
+                table.fnFilter("standard_checkout", 0);
+            } else if ( active == 2 ) {
+                table.fnFilter("onsite_checkout", 0);
+            } else { // all
+                table.fnFilter('', 0);
+            }
+        }
+    });
+ });
+//]]>
+</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 [% INCLUDE 'patron-title.inc' %]</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>
-[% IF ( loop_reading ) %]
+[% INCLUDE 'members-toolbar.inc' %]
+<h1>Circulation history</h1>
+
+[% UNLESS Koha.Preference('intranetreadinghistory') %]
+    <div class="dialog alert">Staff members are not allowed to access patron's checkout history</div>
+[% ELSIF is_anonymous %]
+    <div class="dialog alert">This is the anonymous patron, so no circulation history is displayed. To get a list of anonymized loans, please run a report.</div>
+[% ELSIF ( privacy == 2)  %]
+    <div class="dialog message">This patron has set the privacy rules to never keeping a circulation history.</div>
+[% ELSIF ( !loop_reading ) %]
+    <div class="dialog message">This patron has no circulation history.</div>
+[% ELSE %]
 <form action="/cgi-bin/koha/members/readingrec.pl" method="get"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" /></form>
 
-<div id="pagertable_readingrec">
-[% INCLUDE 'table-pager.inc' perpage='20' %]
-</div>
-<table id="table_readingrec">
-<thead>
-    <th>Date</th>
-       <th>Title</th>
-       <th>Author</th>
-       <th>Call No.</th>
-       <th>Barcode</th>
-       <th>Number of Renewals</th>
-       <th>Checked out on</th>
-       <th>Checked out from</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 %]
-        <td>
-            [% loop_readin.issuestimestamp %]
-        </td>
-        <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% loop_readin.biblionumber %]">[% loop_readin.title |html %]</a></td>
 
-        <td>[% loop_readin.author %]</td>
+<div id="tabs" class="toptabs">
+  [% IF Koha.Preference('OnSiteCheckouts') %]
+  <ul>
+    <li><a href="#readingrec" id="tab_all">All</a></li>
+    <li><a href="#readingrec" id="tab_checkout">Checkouts</a></li>
+    <li><a href="#readingrec" id="tab_onsite_checkout">On-site checkouts</a></li>
+  </ul>
+  [% END %]
+  <div id="readingrec" style="overflow:hidden">
+    <table id="table_readingrec">
+      <thead>
+        <th style="display:none;">Type</th>
+        <th class="title-string">Date</th>
+        <th class="anti-the">Title</th>
+        <th>Author</th>
+        <th>Call no.</th>
+        <th>Barcode</th>
+        <th>Number of renewals</th>
+        <th class="title-string">Checked out on</th>
+        <th>Checked out from</th>
+        <th class="title-string">Date due</th>
+        <th class="title-string">Return date</th>
+      </thead>
+      <tbody>
+      [% FOREACH issue IN loop_reading %]
+        [% IF  issue.returndate  %]<tr>[% ELSE %]<tr class="onissue">[% END %]
+          <td style="display:none;">
+            [% IF issue.onsite_checkout %][% issuetype = 'onsite_checkout' %]
+            [% ELSE %][% issuetype = 'standard_checkout' %]
+            [% END %]
+            [% issuetype %]
+          </td>
+          <td>
+            <span title="[% issue.issuestimestamp %]">[% issue.issuestimestamp | $KohaDates with_hours => 1 %]</span>
+          </td>
+          <td><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% issue.biblionumber %]">[% issue.title |html %]</a></td>
 
-        <td>[% loop_readin.classification %]</td>
+          <td>[% issue.author %]</td>
 
-        <td>[% loop_readin.barcode %]</td>
+          <td>
+            [% IF issue.classification %]
+                [% issue.classification %]
+            [% ELSE %]
+                [% issue.itemcallnumber %]
+            [% END %]
+          </td>
 
-            <td>
-        [% loop_readin.renewals %]</td>
-            <td>
-        [% loop_readin.issuedate %]</td>
-            <td>
-        [% loop_readin.issuingbranch %]</td>
-                       <td>[% IF ( loop_readin.date_due ) %][% loop_readin.date_due %][% ELSE %]&nbsp;[% END %]</td>
-            <td>
-        [% IF ( loop_readin.returndate ) %]
-            [% loop_readin.returndate %]
-        [% ELSE %]
-            Checked Out
-        [% END %]
-       </td>
-</tr>
-[% END %]
-</table>
-[% ELSE %]
-<div class="dialog message">This patron has no circulation history.</div>
+          <td>[% issue.barcode %]</td>
+          <td>[% issue.renewals %]</td>
+          <td>
+            <span title="[% issue.issuedate %]">[% issue.issuedate |$KohaDates with_hours => 1 %]</span>
+          </td>
+          <td>[% Branches.GetName( issue.branchcode ) %]</td>
+          <td>
+            [% IF issue.date_due %]
+                <span title="[% issue.date_due %]">[% issue.date_due |$KohaDates with_hours => 1 %]</span>
+            [% ELSE %]
+                <span title="0000-00-00"></span>
+            [% END %]
+          </td>
+          <td>
+            [% IF  issue.returndate %]
+              <span title="[% issue.returndate %]">[% issue.returndate |$KohaDates with_hours => 1 %]</span>
+            [% ELSE %]
+              <span title="Checked out"><small>Checked out</small></span>
+            [% END %]
+          </td>
+        </tr>
+      [% END %]
+      </tbody>
+    </table>
+  </div>
+</div>
 [% END %]
 </div>
 </div>