Bug 20726: Sort by statuses then ordernumbers
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Tue, 29 May 2018 20:10:58 +0000 (17:10 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Thu, 30 Aug 2018 13:40:38 +0000 (13:40 +0000)
Not received and most recent at the top.

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 8593e41..73f9100 100644 (file)
                         <th>Order number</th>
                         <th class="title-string">Creation date</th>
                         <th class="title-string">Receive date</th>
-                        <th>Status</th>
+                        <th class="title-string">Status</th>
                         <th>Fund</th>
                         <th>Ordered</th>
                         <th>Spent</th>
                         <td>[% IF order.datereceived %]<span title="[% order.datereceived | uri %]">[% order.datereceived | $KohaDates %]</span>[% END %]</td>
                         <td>
                           [% SWITCH order.orderstatus %]
-                            [% CASE 'new' %]New
-                            [% CASE 'ordered' %]Ordered
-                            [% CASE 'partial' %]Partial
-                            [% CASE 'complete' %]Complete
-                            [% CASE 'cancelled' %]Cancelled
+                            [% CASE 'new' %]<span title="status_1">New</span>
+                            [% CASE 'ordered' %]<span title="status_2">Ordered</span>
+                            [% CASE 'partial' %]<span title="status_3">Partial</span>
+                            [% CASE 'complete' %]<span title="status_4">Complete</span>
+                            [% CASE 'cancelled' %]<span title="status_5">Cancelled</span>
                           [% END %]
                         </td>
                         <td>[% order.fund.budget_name | html %]</td>
             var table = $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, {
                 'bPaginate': false,
                 'bAutoWidth': false,
-                "aaSorting": [[ 4, "desc" ]],
+                "aaSorting": [[ 5, "asc" ], [ 2, "desc" ]], // Order by status then ordernumber
                 "aoColumnDefs": [
                     { "aTargets": "title-string", "sType": "title-string" }
                 ]
 
             $("#hide_received_orders").click(function(e){
                 e.preventDefault();
-                table.fnFilter( '.', 4, true ); // Not empty "Receive date" columns
+                table.fnFilter( '^$', 4, true ); // Not empty "Receive date" columns
             });
             $("#show_all_orders").click(function(e){
                 e.preventDefault();