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 <katrin.fischer@bsz-bw.de>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Martin Renvoize 2022-06-27 14:47:03 +01:00 committed by Tomas Cohen Arazi
parent b8a2fdcd48
commit d711d45f4e
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
2 changed files with 7 additions and 3 deletions

View File

@ -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;
}

View File

@ -637,7 +637,7 @@ Note that permanent location is a code, and location may be an authval.
[% END %]
[% END %]
[% IF bundlesEnabled %]
<button class="btn btn-default btn-xs details-control"><i class="fa fa-folder"></i> Manage bundle</button>
<button class="btn btn-default btn-xs details-control"><i class="fa fa-folder"></i> Manage bundle ([% item.bundled | html %]|[% item.bundled_lost | html %])</button>
[% END %]
</td>
[% END %]