Bug 20726: Add DataTables
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 7 May 2018 23:07:28 +0000 (20:07 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 30 Aug 2018 13:40:38 +0000 (13:40 +0000)
Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Josef Moravec <josef.moravec@gmail.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt

index eb933c8..2dcee5d 100644 (file)
@@ -9,6 +9,7 @@
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Serials &rsaquo; Details for subscription #[% subscriptionid | html %]</title>
 [% INCLUDE 'doc-head-close.inc' %]
+[% Asset.css("css/datatables.css") %]
 </head>
 
 <body id="ser_subscription-detail" class="ser">
         var CONFIRM_DELETE_SUBSCRIPTION = _("Are you sure you want to delete this subscription?");
     </script>
     [% Asset.js("js/serials-toolbar.js") | $raw %]
+    [% INCLUDE 'datatables.inc' %]
     <script type="text/javascript">
         // the english words used in display purposes
         var text = new Array(_("Number"),_("Volume"),_("Issue"),_("Month"),_("Week"),_("Starting with:"),_("Rollover at:"),_("Choose Hemisphere:"),_("Northern"),_("Southern",
                 popup([% subscriptionid | html %]);
                 return false;
             })
+
+            $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, {
+                'bPaginate': false,
+                'bAutoWidth': false,
+                "aaSorting": [[ 4, "desc" ]],
+                "aoColumnDefs": [
+                    { "aTargets": "title-string", "sType": "title-string" }
+                ]
+            }));
+
         });
     </script>
 [% END %]