From: Jonathan Druart Date: Thu, 9 May 2019 17:27:15 +0000 (-0500) Subject: Bug 21588: Add expand/collapse all links to the "Acquisition details" subscriptions X-Git-Url: http://git.equinoxoli.org/?p=koha-equinox.git;a=commitdiff_plain;h=a6d732f563bfcd19691decbb9968dc1f4b25c07c Bug 21588: Add expand/collapse all links to the "Acquisition details" subscriptions In order to make the view cleaner, a librarian may need to expand or collapse all the orders at once. Test plan: - Create a subscription - Create several orders from this subscription (quantity > 1) - Receive partially the orders - Go to the subscription detail page, "Acquisition details" tab => Notice the 2 new links "Expand all" and "Collapse all" Make sure they work as expected. Also note that a bug has been fixed, when the page is loaded the tree is now expanded. Signed-off-by: Liz Rea Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt index a30270a..d7f7cfd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt @@ -351,7 +351,10 @@ Hide already received orders - | Show all orders + | Show all orders + | Expand all + | Collapse all + @@ -498,9 +501,20 @@ [% IF orders_grouped.size %] $(table).treetable({ - expandable: true + expandable: true, + initialState: 'expanded', }); $(table).treetable('expandAll'); + + $("#expand_all").click(function(e){ + e.preventDefault(); + $(table).treetable('expandAll'); + }); + $("#collapse_all").click(function(e){ + e.preventDefault(); + $(table).treetable('collapseAll'); + }); + [% END %] $("#hide_received_orders").click(function(e){