Bug 21467: Add treetable to subscription detail to group orders by parent ordernumber
Sponsored-by: BULAC - http://www.bulac.fr/ Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
This commit is contained in:
parent
40267be085
commit
75d5f496ed
1 changed files with 23 additions and 5 deletions
|
@ -11,6 +11,7 @@
|
|||
<title>Koha › Serials › Details for subscription #[% subscriptionid | html %]</title>
|
||||
[% INCLUDE 'doc-head-close.inc' %]
|
||||
[% Asset.css("css/datatables.css") | $raw %]
|
||||
[% Asset.css("lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css") | $raw %]
|
||||
</head>
|
||||
|
||||
<body id="ser_subscription-detail" class="ser">
|
||||
|
@ -357,6 +358,7 @@
|
|||
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="NoVisible">Timestamp</th>
|
||||
<th>Invoice</th>
|
||||
<th>Basket</th>
|
||||
<th>Order number</th>
|
||||
|
@ -372,7 +374,12 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
[% FOR order IN orders %]
|
||||
<tr>
|
||||
[% IF order.parent_ordernumber != order.ordernumber %]
|
||||
<tr data-tt-id="[% order.ordernumber | html %]" data-tt-parent-id="[% order.parent_ordernumber | html %]">
|
||||
[% ELSE %]
|
||||
<tr data-tt-id="[% order.parent_ordernumber | html %]">
|
||||
[% END %]
|
||||
<td>[% order.timestamp | html %]</td>
|
||||
<td>
|
||||
[% IF order.invoice %]
|
||||
[% IF CAN_user_acquisition %]
|
||||
|
@ -440,6 +447,7 @@
|
|||
</script>
|
||||
[% Asset.js("js/serials-toolbar.js") | $raw %]
|
||||
[% INCLUDE 'datatables.inc' %]
|
||||
[% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
|
||||
[% INCLUDE 'columns_settings.inc' %]
|
||||
<script>
|
||||
// the english words used in display purposes
|
||||
|
@ -454,14 +462,24 @@
|
|||
|
||||
var columns_settings = [% ColumnsSettings.GetColumns( 'serials', 'subscription-detail', 'orders', 'json' ) | $raw %];
|
||||
var table = KohaTable("orders", {
|
||||
"aoColumnDefs": [
|
||||
{ "bVisible": false, "aTargets": [ 'NoVisible' ] },
|
||||
{ "bSortable": false, "aTargets": ["_all"] },
|
||||
{ "aTargets": "title-string", "sType": "title-string" }
|
||||
],
|
||||
|
||||
'bPaginate': false,
|
||||
'bAutoWidth': false,
|
||||
"aaSorting": [[ 5, "asc" ], [ 2, "desc" ]], // Order by status then ordernumber
|
||||
"aoColumnDefs": [
|
||||
{ "aTargets": "title-string", "sType": "title-string" }
|
||||
]
|
||||
'bSort': true,
|
||||
'aaSortingFixed': [[ 0, 'desc' ]],
|
||||
"bSortCellsTop": true
|
||||
}, columns_settings);
|
||||
|
||||
$(table).treetable({
|
||||
expandable: true
|
||||
});
|
||||
$(table).treetable('expandAll');
|
||||
|
||||
$("#hide_received_orders").click(function(e){
|
||||
e.preventDefault();
|
||||
table.fnFilter( '^$', 4, true ); // Not empty "Receive date" columns
|
||||
|
|
Loading…
Reference in a new issue