Bug 27846: (follow-up) Add id back to breadcrumbs container
[srvgit] / koha-tmpl / intranet-tmpl / prog / en / modules / catalogue / issuehistory.tt
index 4cd11ff..656fb2c 100644 (file)
+[% USE raw %]
+[% USE Asset %]
+[% USE Koha %]
 [% USE KohaDates %]
+[% USE Branches %]
+[% USE TablesSettings %]
+[% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
-<title>Koha &rsaquo; Catalog &rsaquo; Checkout history for [% title |html %]</title>
+<title>Koha &rsaquo; Catalog &rsaquo; Checkout history for [% INCLUDE 'biblio-title-head.inc' %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
-<link rel="stylesheet" href="[% themelang %]/css/datatables.css" />
-[% INCLUDE 'datatables.inc' %]
-<script type="text/javascript" id="js">
-$(document).ready(function() {
-    $("#table_issues").dataTable($.extend(true, {}, dataTablesDefaults, {
-            "aoColumns": [
-                null,null,null,null,{ "sType": "title-string" },{ "sType": "title-string" },{ "sType": "title-string" }
-            ],
-            "aaSorting": [[ 4, "desc" ]]
-        })
-    );
-}); </script>
-
 </head>
+
 <body id="catalog_issuehistory" class="catalog">
 
 [% INCLUDE 'header.inc' %]
 [% INCLUDE 'cat-search.inc' %]
 
-<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>  &rsaquo; Checkout history for <i>[% title |html %]</i></div>
+<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
+    <ol>
+        <li>
+            <a href="/cgi-bin/koha/mainpage.pl">Home</a>
+        </li>
+        <li>
+            <a href="/cgi-bin/koha/catalogue/search.pl">Catalog</a>
+        </li>
+        <li>
+            [% INCLUDE 'biblio-title.inc' link = 1 %]
+        </li>
+        <li>
+            <a href="#" aria-current="page">
+                Checkout history
+            </a>
+        </li>
+    </ol>
+</nav>
 
-<div id="doc3" class="yui-t2">
+<div class="main container-fluid">
+    <div class="row">
+        <div class="col-sm-10 col-sm-push-2">
+            <main>
 
-   <div id="bd">
-       <div id="yui-main">
-       <div class="yui-b">
+<h1>Checkout history for [% INCLUDE 'biblio-title.inc' %]</h1>
+[% IF biblio.author %]<h3>by [% biblio.author | html %]</h3>[% END %]
 
-<h1>Checkout history for [% title |html %]</h1>
-[% IF ( author ) %]<h3>by [% author %]</h3>[% END %]
+[% SET show_patron_column = Koha.Preference('intranetreadinghistory') AND CAN_user_circulate_circulate_remaining_permissions %]
 
 <div class="searchresults">
-    [% IF ( issues ) %]
-        <h4>Checked out [% total %] times</h4>
+    [% IF checkouts %]
+        <h4>Checked out [% checkouts.size | html %] times</h4>
         <table id="table_issues">
             <thead><tr>
+            [% IF show_patron_column %]
             <th>Patron</th>
+            [% END %]
             <th>Barcode</th>
             <th>Checked out from</th>
+            [% IF Koha.Preference('RecordStaffUserOnCheckout') %]
+            <th>Checked out by</th>
+            [% END %]
             <th>Renewed</th>
-            <th>Checkout on</th>
-            <th>Due date</th>
-            <th>Checkin on</th>
+            <th class='title-string'>Checkout on</th>
+            <th class='title-string'>Due date</th>
+            <th class='title-string'>Checkin on</th>
             </tr></thead>
             <tbody>
-        [% FOREACH issue IN issues %]
-        [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
-                <td><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% issue.borrowernumber %]">[% IF HidePatronName %][% issue.cardnumber %][% ELSE %][% issue.surname %][% IF ( issue.firstname ) %], [% issue.firstname %][% END %][% END %]</a></td>
-                <td>[% IF ( issue.barcode ) %]
-                        <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% issue.biblionumber %]&amp;itemnumber=[% issue.itemnumber %]">[% issue.barcode %]</a>
+        [% FOREACH checkout IN checkouts %]
+            <tr>
+                [% IF show_patron_column %]
+                    <td>
+                        [% IF checkout.patron %][%# Not set for deleted patron records %]
+                            [% INCLUDE 'patron-title.inc' patron => checkout.patron hide_patron_infos_if_needed=1 %]
+                        [% END %]
+                    </td>
+                [% END %]
+                <td>
+                    [% IF checkout.item.barcode %] [%# FIXME This test is not mandatory I think %]
+                        <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% checkout.item.biblionumber | uri %]&amp;itemnumber=[% checkout.item.itemnumber | uri %]">[% checkout.item.barcode | html %]</a>
                     [% ELSE %]
                         &nbsp;
                     [% END %]</td>
-                <td>[% IF ( issue.branchcode ) %]
-                        [% issue.branchcode %]
+                <td>[% IF checkout.branchcode %]
+                        [% Branches.GetName( checkout.branchcode ) | html %]
                     [% ELSE %]
                         &nbsp;
                     [% END %]</td>
-                <td>[% IF ( issue.renewals ) %]
-                        Yes[% IF ( issue.lastreneweddate ) %], <small>last on: [% issue.lastreneweddate |$KohaDates with_hours => 1  %]</small>
+                [% IF Koha.Preference('RecordStaffUserOnCheckout') %]
+                <td>[% IF checkout.issuer_id %]
+                    <a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% checkout.issuer_id | uri %]">
+                    [% INCLUDE 'patron-title.inc' patron=checkout.issuer_id %]
+                    </a>
+                    [% END %]</td>
+                [% END %]
+                <td>[% IF checkout.renewals %]
+                        Yes[% IF checkout.lastreneweddate %], <small>last on: [% checkout.lastreneweddate |$KohaDates  with_hours => 1 %]</small>
                             [% END %]
                     [% ELSE %]
                         No
                     [% END %]</td>
-                <td>[% IF ( issue.issuedate ) %]
-                        <span title="[% issue.issuedate %]">[% issue.issuedate |$KohaDates with_hours => 1  %]</span>
+                <td>[% IF checkout.issuedate %]
+                        <span title="[% checkout.issuedate | html %]">[% checkout.issuedate |$KohaDates  with_hours => 1 %]</span>
                     [% ELSE %]
                         <span title="0000-00-00"></span>
                     [% END %]</td>
-                <td>[% IF ( issue.date_due ) %]
-                        <span title="[% issue.date_due %]">[% issue.date_due |$KohaDates with_hours => 1  %]</span>
+                <td>[% IF checkout.date_due %]
+                        <span title="[% checkout.date_due | html %]">[% checkout.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>
+                <td>[% IF checkout.returndate %]
+                        <span title="[% checkout.returndate | html %]">[% checkout.returndate |$KohaDates  with_hours => 1 %]</span>
                     [% ELSE %]
-                        <span title="0000-00-00"></span>
+                        <span title="Checked out"><small>Checked out</small></span>
                     [% END %]</td>
            </tr>
         [% END %]
@@ -86,15 +117,38 @@ $(document).ready(function() {
                </table>
     [% ELSE %]
         <div class="dialog message"><p>
-        <b>[% title |html %][% IF ( author ) %], by [% author %][% END %]</b> has never been checked out.</p></div>
+        <strong>[% biblio.title | html %][% IF biblio.author %], by [% biblio.author | html %][% END %]</strong> has never been checked out.</p></div>
 
     [% END %]
 </div>
 
-</div>
-</div>
-<div class="yui-b">
-[% INCLUDE 'biblio-view-menu.inc' %]
-</div>
-</div>
+            </main>
+        </div> <!-- /.col-sm-10.col-sm-push-2 -->
+
+        <div class="col-sm-2 col-sm-pull-10">
+            <aside>
+                [% INCLUDE 'biblio-view-menu.inc' %]
+            </aside>
+        </div> <!-- /.col-sm-2.col-sm-pull-10 -->
+     </div> <!-- /.row -->
+
+[% MACRO jsinclude BLOCK %]
+[% INCLUDE 'datatables.inc' %]
+[% INCLUDE 'columns_settings.inc' %]
+    <script id="js">
+        $(document).ready(function() {
+            var columns_settings = [% TablesSettings.GetColumns('catalogue', 'detail', 'checkoutshistory-table', 'json') %];
+            [% UNLESS show_patron_column %]
+            // Remove the patron column definition
+            columns_settings.splice(0,1);
+            [% END %]
+            var table = KohaTable("table_issues", {
+                "sDom": 'C<"top pager"ilpfB><"#filter_c">tr<"bottom pager"ip>',
+                "aaSorting": [[ 4, "desc" ]],
+                "sPaginationType": "full_numbers"
+            }, columns_settings);
+        });
+    </script>
+[% END %]
+
 [% INCLUDE 'intranet-bottom.inc' %]