Bug 25503

Summary: Add option to export items bundle contents in checkouts table
Product: Koha Reporter: Julian Maurice <julian.maurice>
Component: CirculationAssignee: Julian Maurice <julian.maurice>
Status: CLOSED FIXED QA Contact: Katrin Fischer <katrin.fischer>
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, danyonsewell, fridolin.somers, gmcharlt, kyle.m.hall, marie-luce.laflamme, martin.renvoize, matt.blenkinsop, tomascohen, victor
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Caroline Cyr La Rose Documentation submission: https://gitlab.com/koha-community/koha-manual/-/merge_requests/697
Text to go in the release notes:
Version(s) released in:
23.05.00
Circulation function:
Bug Depends on: 28854    
Bug Blocks:    
Attachments: Bug 25503: Add option to export items bundle contents in checkouts table
Bug 25503: Add option to export items bundle contents in checkouts table
Bug 25503: Add option to export items bundle contents in checkouts table
Bug 25503: Add option to export items bundle contents in checkouts table
Bug 25503: Add option to export items bundle contents in checkouts table
Bug 25503: Make Koha::Exporter::Record tests pass with unimarc
Bug 25503: Add failing test for _get_biblio_for_export
Bug 25503: Make _get_biblio_for_export test pass
Bug 25503: Add option to export items bundle contents in checkouts table
Bug 25503: Make Koha::Exporter::Record tests pass with unimarc
Bug 25503: Add failing test for _get_biblio_for_export
Bug 25503: Make _get_biblio_for_export test pass
Bug 25503: Add option to export items bundle contents in checkouts table

Description Julian Maurice 2020-05-14 12:36:10 UTC

    
Comment 1 Julian Maurice 2020-05-14 12:36:56 UTC
Created attachment 104879 [details] [review]
Bug 25503: Add option to export items bundle contents in checkouts table

This patch depends on bug 24023

Test plan:
1. Apply bug 24023 + this patch, run updatedatabase && update_dbix.
2. Enable system preference ExportCircHistory
3. Create a biblio record with one item
4. On the biblio details page, click on 'Edit -> Link elements'. Link at
   least one item
5. Check out the item created at step 3
6. In the checkouts table, check the box in column "Export",
   choose export format 'MARC with items', check "Export items bundle
   contents" and click on "Export" button
   The exported file should contain the biblio and item created at step
   3, but also the item linked at step 4 with its biblio record
Comment 2 Fridolin Somers 2021-03-15 15:50:44 UTC
Need signoff ?
Comment 3 Martin Renvoize (ashimema) 2022-05-16 14:29:50 UTC
This is on my target list to rebase against the 28854 reworking of the original code in 24023
Comment 4 Julian Maurice 2022-09-23 12:49:44 UTC
Created attachment 140901 [details] [review]
Bug 25503: Add option to export items bundle contents in checkouts table

Test plan:
1. Enable system preference ExportCircHistory
2. Create an item bundle (see bug 28854 comment 458)
3. Check out the item bundle
4. In the checkouts table, check the box in column "Export",
   choose export format 'MARC with items', check "Export items bundle
   contents" and click on "Export" button
   The exported file should contain the biblio and item created at step
   2, but also the biblio and items that are part of the bundle
Comment 5 Julian Maurice 2022-09-23 12:51:47 UTC
Patch rebased and reworked to work with bug 28854
Comment 6 Marie-Luce Laflamme 2022-09-23 15:06:53 UTC Comment hidden (obsolete)
Comment 7 Marie-Luce Laflamme 2022-09-23 16:08:05 UTC
It's work with these steps
Test plan:
1. Apply bug 25503
2. Enable system preference ExportCircHistory
2. Create an item bundle (see bug 28854 comment 458)
3. Check out the item bundle
4. In the checkouts table, check the box in column "Export",
   Below the checkout lists, choose export format 'MARC with items', check "Export items bundle contents" and click on "Export" button
The exported file should contain the biblio and item created at step
2, but also the biblio and items that are part of the bundle.
Comment 8 ByWater Sandboxes 2022-09-23 16:09:31 UTC
Created attachment 140956 [details] [review]
Bug 25503: Add option to export items bundle contents in checkouts table

Test plan:
1. Enable system preference ExportCircHistory
2. Create an item bundle (see bug 28854 comment 458)
3. Check out the item bundle
4. In the checkouts table, check the box in column "Export",
   choose export format 'MARC with items', check "Export items bundle
   contents" and click on "Export" button
   The exported file should contain the biblio and item created at step
   2, but also the biblio and items that are part of the bundle

Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>
Comment 9 Victor Grousset/tuxayo 2022-09-23 16:23:10 UTC
Changing to Signed-off then. Thanks Marie-Luce :)
Comment 10 Katrin Fischer 2022-10-02 09:56:22 UTC
Created attachment 141206 [details] [review]
Bug 25503: Add option to export items bundle contents in checkouts table

Test plan:
1. Enable system preference ExportCircHistory
2. Create an item bundle (see bug 28854 comment 458)
3. Check out the item bundle
4. In the checkouts table, check the box in column "Export",
   choose export format 'MARC with items', check "Export items bundle
   contents" and click on "Export" button
   The exported file should contain the biblio and item created at step
   2, but also the biblio and items that are part of the bundle

Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 11 Katrin Fischer 2022-10-02 09:57:20 UTC
This works nicely. Maybe the UI could improved a little bit to separate the options visually a little better, but not a blocker here.
Comment 12 Tomás Cohen Arazi (tcohen) 2022-10-27 12:49:30 UTC
Comment on attachment 141206 [details] [review]
Bug 25503: Add option to export items bundle contents in checkouts table

Review of attachment 141206 [details] [review]:
-----------------------------------------------------------------

::: Koha/Exporter/Record.pm
@@ +132,4 @@
>                  record       => $record,
>                  embed_items  => 1,
>                  biblionumber => $biblionumber,
> +                itemnumbers => $itemnumbers,

Could we have some test for this particular change that feels like fixing a bug? Thanks!
Comment 13 PTFS Europe Sandboxes 2022-10-27 13:46:40 UTC
Created attachment 142715 [details] [review]
Bug 25503: Add option to export items bundle contents in checkouts table

Test plan:
1. Enable system preference ExportCircHistory
2. Create an item bundle (see bug 28854 comment 458)
3. Check out the item bundle
4. In the checkouts table, check the box in column "Export",
   choose export format 'MARC with items', check "Export items bundle
   contents" and click on "Export" button
   The exported file should contain the biblio and item created at step
   2, but also the biblio and items that are part of the bundle

Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>
Comment 14 Julian Maurice 2022-11-04 08:57:02 UTC
Created attachment 143165 [details] [review]
Bug 25503: Make Koha::Exporter::Record tests pass with unimarc
Comment 15 Julian Maurice 2022-11-04 08:57:07 UTC
Created attachment 143166 [details] [review]
Bug 25503: Add failing test for _get_biblio_for_export
Comment 16 Julian Maurice 2022-11-04 08:57:12 UTC
Created attachment 143167 [details] [review]
Bug 25503: Make _get_biblio_for_export test pass
Comment 17 Julian Maurice 2022-11-04 08:57:16 UTC
Created attachment 143168 [details] [review]
Bug 25503: Add option to export items bundle contents in checkouts table

Test plan:
1. Enable system preference ExportCircHistory
2. Create an item bundle (see bug 28854 comment 458)
3. Check out the item bundle
4. In the checkouts table, check the box in column "Export",
   choose export format 'MARC with items', check "Export items bundle
   contents" and click on "Export" button
   The exported file should contain the biblio and item created at step
   2, but also the biblio and items that are part of the bundle

Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>
Comment 18 Danyon Sewell 2023-01-10 21:32:08 UTC
(In reply to Julian Maurice from comment #17)
> Created attachment 143168 [details] [review] [review]
> Bug 25503: Add option to export items bundle contents in checkouts table
> 
> Test plan:
> 1. Enable system preference ExportCircHistory
> 2. Create an item bundle (see bug 28854 comment 458)
> 3. Check out the item bundle
> 4. In the checkouts table, check the box in column "Export",
>    choose export format 'MARC with items', check "Export items bundle
>    contents" and click on "Export" button
>    The exported file should contain the biblio and item created at step
>    2, but also the biblio and items that are part of the bundle
> 
> Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>
> 
> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
> 
> Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>

> Signed-off-by: Danyon Sewell <danyonsewell@catalyst.net.nz>
Comment 19 Victor Grousset/tuxayo 2023-01-12 23:27:25 UTC
Thanks Danyon for testing :)

To completely make a signoff, see this page:
https://wiki.koha-community.org/wiki/Sign_off_on_patches

The quickest method might be to create a sandbox, apply the patches to it, and directly[1] on the sandboxes management interface do "actions" => "signoff patches".
And it will directly add your signoff to all the patches and reattach them here.

Whichever method you choose, feel free to ask for help if something looks wrong in the chat or the general list.
https://koha-community.org/get-involved/irc/
https://koha-community.org/support/koha-mailing-lists/


[1] no need to actually test them again on the sandbox since you already tested them locally
Comment 20 Martin Renvoize (ashimema) 2023-02-02 14:18:15 UTC
Created attachment 146005 [details] [review]
Bug 25503: Make Koha::Exporter::Record tests pass with unimarc

Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

https://bugs.koha-community.org/show_bug.cgi?id=25508
Comment 21 Martin Renvoize (ashimema) 2023-02-02 14:18:21 UTC
Created attachment 146006 [details] [review]
Bug 25503: Add failing test for _get_biblio_for_export

Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

https://bugs.koha-community.org/show_bug.cgi?id=25508
Comment 22 Martin Renvoize (ashimema) 2023-02-02 14:18:26 UTC
Created attachment 146007 [details] [review]
Bug 25503: Make _get_biblio_for_export test pass

Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

https://bugs.koha-community.org/show_bug.cgi?id=25508
Comment 23 Martin Renvoize (ashimema) 2023-02-02 14:18:32 UTC
Created attachment 146008 [details] [review]
Bug 25503: Add option to export items bundle contents in checkouts table

Test plan:
1. Enable system preference ExportCircHistory
2. Create an item bundle (see bug 28854 comment 458)
3. Check out the item bundle
4. In the checkouts table, check the box in column "Export",
   choose export format 'MARC with items', check "Export items bundle
   contents" and click on "Export" button
   The exported file should contain the biblio and item created at step
   2, but also the biblio and items that are part of the bundle

Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Marie-Luce <marie-luce.laflamme@inlibro.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

https://bugs.koha-community.org/show_bug.cgi?id=25508
Comment 24 Martin Renvoize (ashimema) 2023-02-02 14:21:57 UTC
All working as described.. QA scripts are happy and this adds some nice cleanup and improvements to the unit tests.

Whilst I would have loved to see the bundle handling code in a module rather than at the controller, I understand why you did it this way in this case.

Passing QA
Comment 25 Tomás Cohen Arazi (tcohen) 2023-05-10 18:28:20 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 26 Matt Blenkinsop 2023-05-15 10:39:38 UTC
Enhancement - not backporting to 22.11.x