Bug 28854: Expose functionality to attach items to bundles
authorMartin Renvoize <martin.renvoize@ptfs-europe.com>
Thu, 23 Sep 2021 09:01:23 +0000 (10:01 +0100)
committerTomas Cohen Arazi <tomascohen@theke.io>
Wed, 13 Jul 2022 13:35:25 +0000 (10:35 -0300)
commit5f614c05fd3b0691fa5aa0779dbfcb1d0d5b94ec
treecfe842cd35e13ca5f5de6815ae528e07e4282c0f
parent91518ae3755783149f80ba162f7b6eca52be1ad6
Bug 28854: Expose functionality to attach items to bundles

This patch adds methods the the Koha::Item object for managing item
bundling operations and then exposes those methods via the REST API.

We include the new `BundleNotLoanValue` preference for setting not
for loan values when an item is added to a bundle.

Finally, we expose bundle management via the catalogue details page.

Test plan:
0) Apply patches up to this point and run the database update
1) Configuration: `BundleNotLoanValue` should have been set by the
   database update and point to a newly added AV value.
2) Creating a new bundle
   * Add a new bib record
   * Mark the bib record as a 'collection' type by setting leader
     position 7 to 'c'
   * Add a new item to this bib record
   * You should see a new 'Manage bundle' button available in the
     'Actions' column of the Holdings table.
   * Clicking 'Manage bundle' should expand the table to include a new
     row directly beneath this one.
   * Use the new 'Add to bundle' button that appears in this row to
     trigger a modal that allows entering the barcode of items you wish
     to add to the bundle
   * Upon closing the modal, the bundle content table should reload and
     contain your newly associated items.
   * You can subsequently remove an item from a bundle using the new
     'Remove' button.
3) Not for loan
   * Items that have been added into a bundle should now appear as 'Not
     for loan' from their original biblio record and note which bundle
     they belong to.
4) Error cases
   * Try adding an item that already belongs to a bundle to another
     bundle: Note an error is displayed in the modal form.
5) The bundles feature can be disabled by unsetting the
   `BundleNotLoanValue` system preference.

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>
Koha/Item.pm
Koha/REST/V1/Items.pm
admin/columns_settings.yml
api/v1/swagger/definitions/bundle_link.yaml [new file with mode: 0644]
api/v1/swagger/definitions/item.yaml
api/v1/swagger/paths/items.yaml
api/v1/swagger/swagger.yaml
catalogue/detail.pl
koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt