From 24330e3688a65d3e7647a7078617de3d65625dc7 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 9 May 2019 12:27:15 -0500 Subject: [PATCH] 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 --- .../prog/en/modules/serials/subscription-detail.tt | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) 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 a30270abf7..d7f7cfdc09 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){ -- 2.11.0