Bug 32134: Show the bundle size when checked out
authorJulian Maurice <julian.maurice@biblibre.com>
Tue, 8 Nov 2022 14:19:20 +0000 (15:19 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Tue, 13 Dec 2022 17:51:39 +0000 (14:51 -0300)
When checking out a bundle, it can be useful to know the number of items
in this bundle, so that librarians can quickly check if items are
missing.

Test plan:
1. Create a bundle (see bug 28854 comment 458)
2. Check out the bundle.
3. Verify that you have the bundle size in the message below the barcode
   input ("Checked out: [...]. Bundle of X items. Due on [...]")
4. Checkout an item that is not a bundle.
5. Verify that the bundle message does not appear

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt

index 50614e7..c4c42aa 100644 (file)
@@ -9,6 +9,7 @@
 [% USE ItemTypes %]
 [% USE Price %]
 [% USE AuthorisedValues %]
+[% PROCESS 'i18n.inc' %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
 [% Asset.css("lib/jquery/plugins/rowGroup/stylesheets/rowGroup.dataTables.min.css") | $raw %]
 
                                         [% IF ( issue ) %]
                                             <div class="lastchecked">
-                                                <p><strong>Checked out: </strong>[% issue.item.biblio.title | html %] ([% issue.item.barcode | html %]). Due on [% issue.date_due | $KohaDates as_due_date => 1 %]</p>
+                                                <p>
+                                                    <strong>Checked out: </strong>
+                                                    [% issue.item.biblio.title | html %] ([% issue.item.barcode | html %]).
+
+                                                    [% IF issue.item.is_bundle %]
+                                                        [% SET bundle_items_count = issue.item.bundle_items.count %]
+                                                        [% tnx('Bundle of {count} item', 'Bundle of {count} items', bundle_items_count, { count = bundle_items_count }) | html %].
+                                                    [% END %]
+
+                                                    Due on [% issue.date_due | $KohaDates as_due_date => 1 %]
+                                                </p>
                                             </div>
                                         [% END %]
                                     </form> <!-- /#mainform -->