From b4dc9b1243b3b9e666a4b4853ba2233c5193491e Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 27 Jun 2022 14:47:03 +0100 Subject: [PATCH] Bug 28854: (follow-up) Add bundle item status to manage button This patch adds the item counts (Present|Lost) to the 'Manage bundle' button in the catalogue details page. Signed-off-by: Katrin Fischer Signed-off-by: Kyle M Hall --- catalogue/detail.pl | 8 ++++++-- .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/catalogue/detail.pl b/catalogue/detail.pl index b3deb4305ad..22a60909cbe 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -456,8 +456,12 @@ foreach my $item (@items) { } } - if ($item_object->is_bundle) { - $itemfields{bundles} = 1; + if ( $item_object->is_bundle ) { + $item->{bundled} = + $item_object->bundle_items->search( { itemlost => { '!=' => 0 } } ) + ->count; + $item->{bundled_lost} = + $item_object->bundle_items->search( { itemlost => 0 } )->count; $item->{is_bundle} = 1; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt index 0148404bd8a..de58c8896b9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -637,7 +637,7 @@ Note that permanent location is a code, and location may be an authval. [% END %] [% END %] [% IF bundlesEnabled %] - + [% END %] [% END %] -- 2.30.2