@@ -, +, @@ items --- Koha/REST/V1/Items.pm | 5 +++++ api/v1/swagger/definitions/bundle_link.yaml | 3 +++ .../intranet-tmpl/prog/en/modules/catalogue/detail.tt | 11 ++++++++--- 3 files changed, 16 insertions(+), 3 deletions(-) --- a/Koha/REST/V1/Items.pm +++ a/Koha/REST/V1/Items.pm @@ -307,6 +307,7 @@ sub add_to_bundle { ); } + my $add_link = $c->validation->param('body')->{'marc_link'} // 0; return try { my $options = { force_checkin => $body->{force_checkin}, @@ -314,6 +315,10 @@ sub add_to_bundle { }; my $link = $item->add_to_bundle($bundle_item, $options); + 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 @@ -19,4 +19,7 @@ properties: type: - boolean - "null" + 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 @@ -1299,6 +1299,10 @@ Required +
  • + + +
  • @@ -1974,6 +1978,7 @@ }); const barcode = data.external_id; + const marc_link = data.marc_link; /* Report the results */ posting.done(function(data) { @@ -1993,7 +1998,7 @@ .addClass('btn btn-xs') .text(_("Check in and add to bundle")) .on('click', function () { - addToBundle(url, { external_id: barcode, force_checkin: true }); + addToBundle(url, { external_id: barcode, force_checkin: true, marc_link: marc_link }); }); $('#addResult') .empty() @@ -2010,7 +2015,7 @@ .addClass('btn btn-xs') .text(_("Ignore holds and add to bundle")) .on('click', function () { - addToBundle(url, { external_id: barcode, ignore_holds: true }); + addToBundle(url, { external_id: barcode, ignore_holds: true, marc_link: marc_link }); }); $('#addResult') .empty() @@ -2041,7 +2046,7 @@ event.preventDefault(); const url = this.action; - const data = { external_id: this.elements.external_id.value }; + const data = { external_id: this.elements.external_id.value, marc_link: this.elements.bundle_link.checked }; addToBundle(url, data); }); --