Bug 24023 - Add ability to create bundles of items
Summary: Add ability to create bundles of items
Status: RESOLVED DUPLICATE of bug 28854
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Julian Maurice
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-11-12 16:08 UTC by Julian Maurice
Modified: 2022-09-23 12:51 UTC (History)
12 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 24023: Add ability to create bundles of items (49.44 KB, patch)
2019-11-12 16:12 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 24023: Add ability to create bundles of items (49.22 KB, patch)
2020-03-24 12:26 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 24023: Add ability to create bundles of items (49.66 KB, patch)
2020-08-28 14:41 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 24023: Add ability to create bundles of items (49.48 KB, patch)
2020-10-23 13:52 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 24023: Add ability to create bundles of items (49.58 KB, patch)
2021-01-05 09:56 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 24023: Add ability to create bundles of items (49.77 KB, patch)
2021-04-02 07:31 UTC, Julian Maurice
Details | Diff | Splinter Review
Bug 24023: Add ability to create bundles of items (49.87 KB, patch)
2021-04-14 09:49 UTC, Séverine Queune
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Julian Maurice 2019-11-12 16:08:52 UTC
This will add the ability to link items to a bibliographic record, making it a bundle of items.
This bibliographic record can have item on its own, making it possible to reserve and check out bundles of items like a normal item.
Items that are attached to a bundle will have their withdrawn status set, making them impossible to reserve or checkout individually.
Comment 1 Julian Maurice 2019-11-12 16:12:17 UTC
Created attachment 95331 [details] [review]
Bug 24023: Add ability to create bundles of items

This patch adds the ability to link items to a biblio to create bundles
of items that can be reserved and checked out like a regular item.
A withdrawn status will be set to linked items so that they can't be
checked out while they are part of a bundle.
When returning a bundle, the list of items that are part of this bundle
will be displayed, allowing the librarian to verify that all items are
there.
Bundles can also be used in the inventory tool as a filter.

Test plan:
0. Apply the patch, run updatedatabase + update_dbix_class_files
1. Create a biblio record with at least a title. Create an item for this
   biblio record
2. In the biblio 'Edit' menu you have a new option: 'Link elements'.
   Click on it
3. Enter a list of valid and invalid barcodes in the textarea, select a
   withdrawn status and click on 'Continue'
4. Verify that new fields have been added to the MARC record (462 for
   UNIMARC, 774 otherwise)
5. Verify that the withdrawn status has been correctly set for the items
   you have linked
6. Check that the biblionumber of the parent bibliographic record is in
   each linked items uri field
7. Verify that, for item created at step 1, items.materials has been
   updated with the number of items contained in the bundle
8. Edit the biblio record and remove one of the 462/774 fields
9. Verify that the corresponding item's withdrawn status has been reset
10. Check that the uri field in the corresponding items was removed
11. Checkout and checkin the item created at step 1
12. You should see the list of items contained in the bundle. Click on
    'Confirm checkin without verifying'. Verify that the item has been
    returned
13. Checkout and checkin the item created at step 1 again
14. Now click on 'Verify items bundle contents'. A textarea lets you
    enter barcodes. Enter some (but not all) barcodes that are in the
    bundle. Select a 'lost' status and click on 'Confirm checkin and
    mark missing items as lost'
15. Verify that the items corresponding to barcodes you did not type in
    the textarea are now marked as lost with the lost status you chose
16. Go to the inventory tool, use the bundle filter and verify that it
    works

Sponsored-by: Bibliothèque Départementale de l'Yonne
Comment 2 Séverine Queune 2019-11-15 14:44:27 UTC
Hi Julian,

I've got a tiny issue on step 6, for url is not complete (detail.pl?biblionumber= is missing). Did I forgot a setting somewhere ?
Except this point, everything is ok for me !

In the future, do you think the feature could be decline to link items using the itemnumber ? I'm thinking of it for some of our collections, it would be really helpfull !
Comment 3 Julian Maurice 2019-11-15 15:00:02 UTC
(In reply to Séverine Queune from comment #2)
> Hi Julian,
> 
> I've got a tiny issue on step 6, for url is not complete
> (detail.pl?biblionumber= is missing). Did I forgot a setting somewhere ?

No, there's a problem here that need to be fixed. Thanks.

> Except this point, everything is ok for me !
> 
> In the future, do you think the feature could be decline to link items using
> the itemnumber ? I'm thinking of it for some of our collections, it would be
> really helpfull !

Yes, that shouldn't be too hard to implement
Comment 4 Julian Maurice 2020-03-24 12:26:10 UTC
Created attachment 101555 [details] [review]
Bug 24023: Add ability to create bundles of items

This patch adds the ability to link items to a biblio to create bundles
of items that can be reserved and checked out like a regular item.
A withdrawn status will be set to linked items so that they can't be
checked out while they are part of a bundle.
When returning a bundle, the list of items that are part of this bundle
will be displayed, allowing the librarian to verify that all items are
there.
Bundles can also be used in the inventory tool as a filter.

Test plan:
0. Apply the patch, run updatedatabase + update_dbix_class_files
1. Create a biblio record with at least a title. Create an item for this
   biblio record
2. In the biblio 'Edit' menu you have a new option: 'Link elements'.
   Click on it
3. Enter a list of valid and invalid barcodes in the textarea, select a
   withdrawn status and click on 'Continue'
4. Verify that new fields have been added to the MARC record (462 for
   UNIMARC, 774 otherwise)
5. Verify that the withdrawn status has been correctly set for the items
   you have linked
6. Verify that, for item created at step 1, items.materials has been
   updated with the number of items contained in the bundle
7. Edit the biblio record and remove one of the 462/774 fields
8. Verify that the corresponding item's withdrawn status has been reset
9. Checkout and checkin the item created at step 1
10. You should see the list of items contained in the bundle. Click on
    'Confirm checkin without verifying'. Verify that the item has been
    returned
11. Checkout and checkin the item created at step 1 again
12. Now click on 'Verify items bundle contents'. A textarea lets you
    enter barcodes. Enter some (but not all) barcodes that are in the
    bundle. Select a 'lost' status and click on 'Confirm checkin and
    mark missing items as lost'
13. Verify that the items corresponding to barcodes you did not type in
    the textarea are now marked as lost with the lost status you chose
14. Go to the inventory tool, use the bundle filter and verify that it
    works

Sponsored-by: Bibliothèque Départementale de l'Yonne
Comment 5 Julian Maurice 2020-03-24 12:28:15 UTC
I removed the parts that were modifying items.uri. The idea was to easily jump from the item to its bundle, but it may not be the best way. It can be added in another bug if needed.

Back to needs signoff
Comment 6 Donna 2020-03-24 16:02:13 UTC
Test plan fails at step 10.  Deleting a 774 field has the following impact:
a) the materials specified in the top level bib is removed
b) items are still showing as attached in the 774, but the individual item records no longer show the withdrawn status and are instead showing as available.

If you continue with the test plan and check out the item from step 1, none of the attached items show as checked out, and upon checking in the item from step one, no list of titles.
Comment 7 Julian Maurice 2020-04-10 06:37:13 UTC
(In reply to Donna from comment #6)
> Test plan fails at step 10.  Deleting a 774 field has the following impact:
> a) the materials specified in the top level bib is removed

materials is at the item level (the item created at step 1). Can you confirm that you verified the item ? Because I can't reproduce the issue. For me the number in items.materials is correctly decreased.

> b) items are still showing as attached in the 774, but the individual item
> records no longer show the withdrawn status and are instead showing as
> available.

You deleted a 774 field and it's still there ? Or do you mean that the other 774 fields (the ones that you have not deleted) are still there ?

> If you continue with the test plan and check out the item from step 1, none
> of the attached items show as checked out, and upon checking in the item
> from step one, no list of titles.

None of the attached items should show as checked out, that's normal.

https://snipboard.io/2zf1js.jpg : that's what you should get when checking in the item from step 1. You didn't have that ?
Comment 8 Julian Maurice 2020-04-10 09:00:47 UTC
Changing status to needs signoff to get feedback
Comment 9 Julian Maurice 2020-08-28 14:41:31 UTC
Created attachment 109287 [details] [review]
Bug 24023: Add ability to create bundles of items

This patch adds the ability to link items to a biblio to create bundles
of items that can be reserved and checked out like a regular item.
A withdrawn status will be set to linked items so that they can't be
checked out while they are part of a bundle.
When returning a bundle, the list of items that are part of this bundle
will be displayed, allowing the librarian to verify that all items are
there.
Bundles can also be used in the inventory tool as a filter.

Test plan:
0. Apply the patch, run updatedatabase + update_dbix_class_files
1. Create a biblio record with at least a title. Create an item for this
   biblio record
2. In the biblio 'Edit' menu you have a new option: 'Link elements'.
   Click on it
3. Enter a list of valid and invalid barcodes in the textarea, select a
   withdrawn status and click on 'Continue'
4. Verify that new fields have been added to the MARC record (462 for
   UNIMARC, 774 otherwise)
5. Verify that the withdrawn status has been correctly set for the items
   you have linked
6. Verify that, for item created at step 1, items.materials has been
   updated with the number of items contained in the bundle
7. Edit the biblio record and remove one of the 462/774 fields
8. Verify that the corresponding item's withdrawn status has been reset
9. Checkout and checkin the item created at step 1
10. You should see the list of items contained in the bundle. Click on
    'Confirm checkin without verifying'. Verify that the item has been
    returned
11. Checkout and checkin the item created at step 1 again
12. Now click on 'Verify items bundle contents'. A textarea lets you
    enter barcodes. Enter some (but not all) barcodes that are in the
    bundle. Select a 'lost' status and click on 'Confirm checkin and
    mark missing items as lost'
13. Verify that the items corresponding to barcodes you did not type in
    the textarea are now marked as lost with the lost status you chose
14. Go to the inventory tool, use the bundle filter and verify that it
    works

Sponsored-by: Bibliothèque Départementale de l'Yonne
Comment 10 Séverine Queune 2020-10-23 13:14:47 UTC
Hi Julian,
I got these conflicts trying to apply the patch.
Would be happy to test it next week if you can fix it !

Falling back to patching base and 3-way merge...
Auto-merging tools/inventory.pl
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt
Auto-merging installer/data/mysql/kohastructure.sql
CONFLICT (content): Merge conflict in installer/data/mysql/kohastructure.sql
Auto-merging circ/returns.pl
Auto-merging catalogue/detail.pl
CONFLICT (content): Merge conflict in catalogue/detail.pl
Auto-merging admin/columns_settings.yml
Auto-merging C4/Items.pm
Auto-merging C4/Biblio.pm
CONFLICT (content): Merge conflict in C4/Biblio.pm
Failed to merge in the changes.
Patch failed at 0001 Bug 24023: Add ability to create bundles of items
Comment 11 Julian Maurice 2020-10-23 13:52:30 UTC
Created attachment 112275 [details] [review]
Bug 24023: Add ability to create bundles of items

This patch adds the ability to link items to a biblio to create bundles
of items that can be reserved and checked out like a regular item.
A withdrawn status will be set to linked items so that they can't be
checked out while they are part of a bundle.
When returning a bundle, the list of items that are part of this bundle
will be displayed, allowing the librarian to verify that all items are
there.
Bundles can also be used in the inventory tool as a filter.

Test plan:
0. Apply the patch, run updatedatabase + update_dbix_class_files
1. Create a biblio record with at least a title. Create an item for this
   biblio record
2. In the biblio 'Edit' menu you have a new option: 'Link elements'.
   Click on it
3. Enter a list of valid and invalid barcodes in the textarea, select a
   withdrawn status and click on 'Continue'
4. Verify that new fields have been added to the MARC record (462 for
   UNIMARC, 774 otherwise)
5. Verify that the withdrawn status has been correctly set for the items
   you have linked
6. Verify that, for item created at step 1, items.materials has been
   updated with the number of items contained in the bundle
7. Edit the biblio record and remove one of the 462/774 fields
8. Verify that the corresponding item's withdrawn status has been reset
9. Checkout and checkin the item created at step 1
10. You should see the list of items contained in the bundle. Click on
    'Confirm checkin without verifying'. Verify that the item has been
    returned
11. Checkout and checkin the item created at step 1 again
12. Now click on 'Verify items bundle contents'. A textarea lets you
    enter barcodes. Enter some (but not all) barcodes that are in the
    bundle. Select a 'lost' status and click on 'Confirm checkin and
    mark missing items as lost'
13. Verify that the items corresponding to barcodes you did not type in
    the textarea are now marked as lost with the lost status you chose
14. Go to the inventory tool, use the bundle filter and verify that it
    works

Sponsored-by: Bibliothèque Départementale de l'Yonne
Comment 12 Julian Maurice 2020-10-23 13:56:37 UTC
(In reply to Séverine Queune from comment #10)
> Would be happy to test it next week if you can fix it !

Patch rebased on master !
I wouldn't want to deprive you of the joy of testing this patch :-)
Comment 13 Séverine Queune 2020-10-23 16:56:46 UTC
Thanks Julian !
It's been a while I wanted to test that one !!
It's a really great feature, and I have some questions about it.


> 3. Enter a list of valid and invalid barcodes in the textarea, select a
>    withdrawn status and click on 'Continue'
Could we imagine (in another bug probably to not block that one) to link items using itemnumber ? I think of using this feature for our "Recueils factices" (different small publications bound together) and they only have 1 barcode.

> 4. Verify that new fields have been added to the MARC record (462 for
>    UNIMARC, 774 otherwise)
Is it normal links between records are visible only on direction host > linked item, and not the other direction ? I didn't see information on a linked items record except on item table, and there are no informations displayed in the OPAC neither.
Can we imagine a way to easily see the bundle items, without opening the MARC view, like a modal opening when clicking on the "Materials specified" number ?

> 9. Checkout and checkin the item created at step 1
When the item is checked out, linked items stay 'Available' on both intranet and OPAC, I don't think that clear enough for users.

> 12. Now click on 'Verify items bundle contents'. A textarea lets you
>     enter barcodes. Enter some (but not all) barcodes that are in the
>     bundle. Select a 'lost' status and click on 'Confirm checkin and
>     mark missing items as lost'
I juste LOVE the highlight of item when you enter the barcode !
That's really clear to see which barcodes are missing !

> 14. Go to the inventory tool, use the bundle filter and verify that it
>     works
Is it a wish the host item is not displayed in the inventory list ?
Buttons "Mark seen and continue" and "Continue without marking" don't work.

Mark it as failed because of the issue on inventory tool, and maybe the visibility of items checked out, but it's really great !
Comment 14 Julian Maurice 2021-01-05 09:33:38 UTC
(In reply to Séverine Queune from comment #13)
> Could we imagine (in another bug probably to not block that one) to link
> items using itemnumber ? I think of using this feature for our "Recueils
> factices" (different small publications bound together) and they only have 1
> barcode.
It is certainly possible to add this feature later.

> Is it normal links between records are visible only on direction host >
> linked item, and not the other direction ? I didn't see information on a
> linked items record except on item table, and there are no informations
> displayed in the OPAC neither.
That's normal, though we can probably add this information wherever it makes sense.

> Can we imagine a way to easily see the bundle items, without opening the
> MARC view, like a modal opening when clicking on the "Materials specified"
> number ?
We can imagine it :)

> > 9. Checkout and checkin the item created at step 1
> When the item is checked out, linked items stay 'Available' on both intranet
> and OPAC, I don't think that clear enough for users.
Have you set the withdrawn status when linking an item to the items bundle ? Otherwise bundled items always appear as available.

> > 14. Go to the inventory tool, use the bundle filter and verify that it
> >     works
> Is it a wish the host item is not displayed in the inventory list ?
> Buttons "Mark seen and continue" and "Continue without marking" don't work.
> 
> Mark it as failed because of the issue on inventory tool, and maybe the
> visibility of items checked out, but it's really great !

Have you checked that the inventory tool buttons work on master ? This patch only adds a filter so I don't see how that can break these features.
Comment 15 Julian Maurice 2021-01-05 09:56:48 UTC
Created attachment 114855 [details] [review]
Bug 24023: Add ability to create bundles of items

This patch adds the ability to link items to a biblio to create bundles
of items that can be reserved and checked out like a regular item.
A withdrawn status will be set to linked items so that they can't be
checked out while they are part of a bundle.
When returning a bundle, the list of items that are part of this bundle
will be displayed, allowing the librarian to verify that all items are
there.
Bundles can also be used in the inventory tool as a filter.

Test plan:
0. Apply the patch, run updatedatabase + update_dbix_class_files
1. Create a biblio record with at least a title. Create an item for this
   biblio record
2. In the biblio 'Edit' menu you have a new option: 'Link elements'.
   Click on it
3. Enter a list of valid and invalid barcodes in the textarea, select a
   withdrawn status and click on 'Continue'
4. Verify that new fields have been added to the MARC record (462 for
   UNIMARC, 774 otherwise)
5. Verify that the withdrawn status has been correctly set for the items
   you have linked
6. Verify that, for item created at step 1, items.materials has been
   updated with the number of items contained in the bundle
7. Edit the biblio record and remove one of the 462/774 fields
8. Verify that the corresponding item's withdrawn status has been reset
9. Checkout and checkin the item created at step 1
10. You should see the list of items contained in the bundle. Click on
    'Confirm checkin without verifying'. Verify that the item has been
    returned
11. Checkout and checkin the item created at step 1 again
12. Now click on 'Verify items bundle contents'. A textarea lets you
    enter barcodes. Enter some (but not all) barcodes that are in the
    bundle. Select a 'lost' status and click on 'Confirm checkin and
    mark missing items as lost'
13. Verify that the items corresponding to barcodes you did not type in
    the textarea are now marked as lost with the lost status you chose
14. Go to the inventory tool, use the bundle filter and verify that it
    works

Sponsored-by: Bibliothèque Départementale de l'Yonne
Comment 16 Séverine Queune 2021-04-01 08:20:15 UTC
Argh... Sorry Julian... 

Falling back to patching base and 3-way merge...
Auto-merging tools/inventory.pl
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/circ/returns.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/cat-toolbar.inc
Auto-merging installer/data/mysql/kohastructure.sql
CONFLICT (content): Merge conflict in installer/data/mysql/kohastructure.sql
Auto-merging circ/returns.pl
Auto-merging catalogue/detail.pl
Auto-merging admin/columns_settings.yml
Auto-merging C4/Items.pm
Auto-merging C4/Biblio.pm
error: Failed to merge in the changes.
Patch failed at 0001 Bug 24023: Add ability to create bundles of items
The copy of the patch that failed is found in: .git/rebase-apply/patch
When you have resolved this problem run "git bz apply --continue".
If you would prefer to skip this patch, instead run "git bz apply --skip".
To restore the original branch and stop patching run "git bz apply --abort".
Patch left in /tmp/Bug-24023-Add-ability-to-create-bundles-of-items-nCjUy1.patch
Comment 17 Julian Maurice 2021-04-02 07:31:43 UTC
Created attachment 119094 [details] [review]
Bug 24023: Add ability to create bundles of items

This patch adds the ability to link items to a biblio to create bundles
of items that can be reserved and checked out like a regular item.
A withdrawn status will be set to linked items so that they can't be
checked out while they are part of a bundle.
When returning a bundle, the list of items that are part of this bundle
will be displayed, allowing the librarian to verify that all items are
there.
Bundles can also be used in the inventory tool as a filter.

Test plan:
0. Apply the patch, run updatedatabase + update_dbix_class_files
1. Create a biblio record with at least a title. Create an item for this
   biblio record
2. In the biblio 'Edit' menu you have a new option: 'Link elements'.
   Click on it
3. Enter a list of valid and invalid barcodes in the textarea, select a
   withdrawn status and click on 'Continue'
4. Verify that new fields have been added to the MARC record (462 for
   UNIMARC, 774 otherwise)
5. Verify that the withdrawn status has been correctly set for the items
   you have linked
6. Verify that, for item created at step 1, items.materials has been
   updated with the number of items contained in the bundle
7. Edit the biblio record and remove one of the 462/774 fields
8. Verify that the corresponding item's withdrawn status has been reset
9. Checkout and checkin the item created at step 1
10. You should see the list of items contained in the bundle. Click on
    'Confirm checkin without verifying'. Verify that the item has been
    returned
11. Checkout and checkin the item created at step 1 again
12. Now click on 'Verify items bundle contents'. A textarea lets you
    enter barcodes. Enter some (but not all) barcodes that are in the
    bundle. Select a 'lost' status and click on 'Confirm checkin and
    mark missing items as lost'
13. Verify that the items corresponding to barcodes you did not type in
    the textarea are now marked as lost with the lost status you chose
14. Go to the inventory tool, use the bundle filter and verify that it
    works

Sponsored-by: Bibliothèque Départementale de l'Yonne
Comment 18 Julian Maurice 2021-04-02 07:32:02 UTC
Patch rebased on master
Comment 19 Séverine Queune 2021-04-14 09:49:37 UTC
Created attachment 119554 [details] [review]
Bug 24023: Add ability to create bundles of items

This patch adds the ability to link items to a biblio to create bundles
of items that can be reserved and checked out like a regular item.
A withdrawn status will be set to linked items so that they can't be
checked out while they are part of a bundle.
When returning a bundle, the list of items that are part of this bundle
will be displayed, allowing the librarian to verify that all items are
there.
Bundles can also be used in the inventory tool as a filter.

Test plan:
0. Apply the patch, run updatedatabase + update_dbix_class_files
1. Create a biblio record with at least a title. Create an item for this
   biblio record
2. In the biblio 'Edit' menu you have a new option: 'Link elements'.
   Click on it
3. Enter a list of valid and invalid barcodes in the textarea, select a
   withdrawn status and click on 'Continue'
4. Verify that new fields have been added to the MARC record (462 for
   UNIMARC, 774 otherwise)
5. Verify that the withdrawn status has been correctly set for the items
   you have linked
6. Verify that, for item created at step 1, items.materials has been
   updated with the number of items contained in the bundle
7. Edit the biblio record and remove one of the 462/774 fields
8. Verify that the corresponding item's withdrawn status has been reset
9. Checkout and checkin the item created at step 1
10. You should see the list of items contained in the bundle. Click on
    'Confirm checkin without verifying'. Verify that the item has been
    returned
11. Checkout and checkin the item created at step 1 again
12. Now click on 'Verify items bundle contents'. A textarea lets you
    enter barcodes. Enter some (but not all) barcodes that are in the
    bundle. Select a 'lost' status and click on 'Confirm checkin and
    mark missing items as lost'
13. Verify that the items corresponding to barcodes you did not type in
    the textarea are now marked as lost with the lost status you chose
14. Go to the inventory tool, use the bundle filter and verify that it
    works

Sponsored-by: Bibliothèque Départementale de l'Yonne
Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Comment 20 Séverine Queune 2021-04-14 09:52:03 UTC
Hi Julian !
Thanks again for the rebase !
You were right on comment 14, I probably forgot the withdrawn status the first time I tested it, now status is correct on the OPAC ; and inventory tool is broken on master :)

To me the patch works as described, I already thought about numerous enhancements to this feature (comment 13 was only a few part!) :)
Thanks again !
Comment 21 Séverine Queune 2021-04-14 10:01:40 UTC
I forgot 2 tiny modifications propositions on my last comment : after linking items, the table title 'Barcode' should be centred (I saw it align on right) and a colon is missing after the withdrawn label.
Comment 22 Martin Renvoize 2021-04-20 15:14:08 UTC
Any chance of updating this to Koha:: space Julian?  I note it's lacking unit tests and a move to Koha:: objects would be nice for future maintenance too.
Comment 23 Julian Maurice 2021-04-20 15:31:51 UTC
(In reply to Martin Renvoize from comment #22)
> Any chance of updating this to Koha:: space Julian?  I note it's lacking
> unit tests and a move to Koha:: objects would be nice for future maintenance
> too.

Ah yes, tests are certainly needed. And I suppose it shouldn't be too hard to move it to Koha:: namespace while writing tests.
Comment 24 Martin Renvoize 2021-04-20 15:43:51 UTC
Also.. I'm interested to know how/if this plays nicely with our existing analytics and multi-part biblio support.. EasyAnalytics and UseControlNumber preferences.  Adding 774's seems OK, but I also wonder if we aught to be updating/ensureing the leader's are set correcting (position 7 being set to 'c' for 'Collection' for example.. and the corresponding XSLT linking fields set for display for such host records?)

However, I don't see this comment as a blocker.. more an nice to have, interesting question..

Thanks for looking at a move to Koha::.. it didn't look too crazy hard when I investigated.. :)
Comment 25 Martin Renvoize 2021-04-21 13:41:38 UTC
> 1. Create a biblio record with at least a title. Create an item for this
   biblio record

Can a 'bundle' record not contain multiple items?  I could envisage a standard 'bundle' being created for various uses and then multiple 'items' consisting of a bundled set of materials.?
Comment 26 Julian Maurice 2021-04-21 14:25:01 UTC
(In reply to Martin Renvoize from comment #25)
> > 1. Create a biblio record with at least a title. Create an item for this
>    biblio record
> 
> Can a 'bundle' record not contain multiple items?  I could envisage a
> standard 'bundle' being created for various uses and then multiple 'items'
> consisting of a bundled set of materials.?

The problem is that the bundle is linked to specific items, so once the bundle is checked out, those specific items are not available anymore.
Comment 27 Tomás Cohen Arazi 2021-05-07 16:00:44 UTC
I find the idea really interesting. Have a few questions, though:
- Can we do it in Koha::Item::Bundle(s) instead? Most of the C4::Items CRUD stuffs have been moved to Koha::Item(s) and we have a bunch of handy tools there.
- Bundles would probably end-up being some kind of meta-item types. I don't see anything circ-related (for setting circulation rules on bundles). So, is it going to calculate the circ/hold rules based on one of the items? which? I would go the meta-item type way to simplify things.
- Bug 24857 is introducing the concept of volumes at biblio level. Which sort-of have -implicitly- a similar meta-itype: in that case you place a hold on 'any copy of DVD 2 for Lord of the Rings'. It would be interesting to think how this dev will interact with that one: we could want to place a hold on the three LOTR movies (as a bundle), which would mean instead of a specific item, the bundle could include volume members instead.
- How does checkout work for bundles? You check one item out, it identifies itself as part of a bundle, and checks all out?
Comment 28 Martin Renvoize 2021-09-03 15:53:19 UTC
I've created a modernised version of this in bug 28854... it uses the Koha namespace and API as much as it can and improves on the UX I believe.
Comment 29 Martin Renvoize 2022-05-16 14:28:46 UTC
We decided at Hackfest to work on the "modern" reworking of this together in bug 28854.. closing this original as a duplicate and proceeding to take into account the notes made at hackfest.

*** This bug has been marked as a duplicate of bug 28854 ***