Bug 28854: (follow-up) Add bundle item status to manage button
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 27 Jun 2022 13:47:03 +0000 (14:47 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Wed, 13 Jul 2022 13:36:04 +0000 (10:36 -0300)
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>
catalogue/detail.pl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt

index b3deb43..22a6090 100755 (executable)
@@ -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;
     }
 
index 0148404..de58c88 100644 (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 %]