@@ -, +, @@ items --- Koha/REST/V1/Items.pm | 6 +++++- api/v1/swagger/definitions/bundle_link.yaml | 3 +++ koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 6 +++++- 3 files changed, 13 insertions(+), 2 deletions(-) --- a/Koha/REST/V1/Items.pm +++ a/Koha/REST/V1/Items.pm @@ -199,7 +199,6 @@ sub add_to_bundle { ); } - my $bundle_item_id = $c->validation->param('body')->{'external_id'}; my $bundle_item = Koha::Items->find( { barcode => $bundle_item_id } ); @@ -210,8 +209,13 @@ sub add_to_bundle { ); } + my $add_link = $c->validation->param('body')->{'marc_link'} // 0; return try { my $link = $item->add_to_bundle($bundle_item); + if ($add_link) { + $bundle_item->biblio->link_marc_host( + { biblionumber => $item->biblio->biblionumber } ); + } return $c->render( status => 201, openapi => $bundle_item --- a/api/v1/swagger/definitions/bundle_link.yaml +++ a/api/v1/swagger/definitions/bundle_link.yaml @@ -11,4 +11,7 @@ properties: - string - "null" description: Item barcode + marc_link: + type: boolean + description: Is there a marc link for this item additionalProperties: false --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt @@ -1080,6 +1080,10 @@ Note that permanent location is a code, and location may be an authval. Required +
  • + + +
  • @@ -1599,7 +1603,7 @@ Note that permanent location is a code, and location may be an authval. /* Send the data using post with external_id */ var posting = $.post({ url: url, - data: JSON.stringify({ external_id: $('#external_id').val()}), + data: JSON.stringify({ external_id: $('#external_id').val(), marc_link: $('#link').prop('checked') }), contentType: "application/json; charset=utf-8", dataType: "json" }); --