Bug 20524: Make columns of pending discharges table sortable
authorJulian Maurice <julian.maurice@biblibre.com>
Thu, 5 Apr 2018 11:14:39 +0000 (13:14 +0200)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Fri, 6 Apr 2018 17:51:14 +0000 (14:51 -0300)
Test plan:
1. Enable syspref useDischarge
2. Login to OPAC and ask for a discharge (tab on the left)
3. Login to OPAC with another borrower from another library and ask for
   a discharge
4. Login to intranet, you should see a message about pending discharges,
   and a link. Click on the link.
5. Confirm that the Patron column is sortable and the Allow column is
   not
6. (Optional) You can apply bug 20516 and confirm that the Library
   column is sortable too

Signed-off-by: Axelle Clarisse <axelle.clarisse@univ-amu.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
koha-tmpl/intranet-tmpl/prog/en/modules/members/discharges.tt

index bd2e254..2f63f3d 100644 (file)
@@ -3,6 +3,7 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Patrons &rsaquo; Pending discharge requests</title>
 [% INCLUDE 'doc-head-close.inc' %]
+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
 </head>
 <body id="pat_discharges" class="pat">
 [% INCLUDE 'header.inc' %]
 
 [% MACRO jsinclude BLOCK %]
     <script type="text/javascript" src="[% interface %]/[% theme %]/js/members-menu_[% KOHA_VERSION %].js"></script>
+
+    [% INCLUDE 'datatables.inc' %]
+    <script>
+        $(document).ready(function() {
+            $('#pending_updates table').DataTable($.extend(true, {}, dataTablesDefaults, {
+                paging: false,
+                info: false,
+                searching: false,
+                order: [],
+                columnDefs: [
+                    { targets: -1, orderable: false },
+                ],
+            }));
+        });
+    </script>
 [% END %]
 
 [% INCLUDE 'intranet-bottom.inc' %]