View | Details | Raw Unified | Return to bug 29560
Collapse All | Expand All

(-)a/Koha/REST/V1/Items.pm (+5 lines)
Lines 316-321 sub add_to_bundle { Link Here
316
    return $c->render_resource_not_found("Bundle item")
316
    return $c->render_resource_not_found("Bundle item")
317
        unless $bundle_item;
317
        unless $bundle_item;
318
318
319
    my $add_link = $c->validation->param('body')->{'marc_link'} // 0;
319
    return try {
320
    return try {
320
        my $options = {
321
        my $options = {
321
            force_checkin => $body->{force_checkin},
322
            force_checkin => $body->{force_checkin},
Lines 323-328 sub add_to_bundle { Link Here
323
        };
324
        };
324
325
325
        my $link = $item->add_to_bundle($bundle_item, $options);
326
        my $link = $item->add_to_bundle($bundle_item, $options);
327
        if ($add_link) {
328
            $bundle_item->biblio->link_marc_host(
329
                { biblionumber => $item->biblio->biblionumber } );
330
        }
326
        return $c->render(
331
        return $c->render(
327
            status  => 201,
332
            status  => 201,
328
            openapi => $bundle_item
333
            openapi => $bundle_item
(-)a/api/v1/swagger/definitions/bundle_link.yaml (+3 lines)
Lines 19-22 properties: Link Here
19
    type:
19
    type:
20
      - boolean
20
      - boolean
21
      - "null"
21
      - "null"
22
  marc_link:
23
    type: boolean
24
    description: Is there a marc link for this item
22
additionalProperties: false
25
additionalProperties: false
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt (-4 / +8 lines)
Lines 969-974 Link Here
969
                                    <input type="text" id="external_id" name="external_id" required="required">
969
                                    <input type="text" id="external_id" name="external_id" required="required">
970
                                    <span class="required">Required</span>
970
                                    <span class="required">Required</span>
971
                                </li>
971
                                </li>
972
                                <li>
973
                                    <label for="bundle_link">Add MARC link: </label>
974
                                    <input type="checkbox" name="bundle_link"/>
975
                                </li>
972
                            </ol>
976
                            </ol>
973
                        </fieldset>
977
                        </fieldset>
974
                    </div>
978
                    </div>
Lines 1609-1614 Link Here
1609
                  });
1613
                  });
1610
1614
1611
                  const barcode = data.external_id;
1615
                  const barcode = data.external_id;
1616
                  const marc_link = data.marc_link;
1612
1617
1613
                  /* Report the results */
1618
                  /* Report the results */
1614
                  posting.done(function(data) {
1619
                  posting.done(function(data) {
Lines 1628-1634 Link Here
1628
                                .addClass('btn btn-xs')
1633
                                .addClass('btn btn-xs')
1629
                                .text(_("Check in and add to bundle"))
1634
                                .text(_("Check in and add to bundle"))
1630
                                .on('click', function () {
1635
                                .on('click', function () {
1631
                                    addToBundle(url, { external_id: barcode, force_checkin: true });
1636
                                    addToBundle(url, { external_id: barcode, force_checkin: true, marc_link: marc_link });
1632
                                });
1637
                                });
1633
                              $('#addResult')
1638
                              $('#addResult')
1634
                                .empty()
1639
                                .empty()
Lines 1645-1651 Link Here
1645
                                .addClass('btn btn-xs')
1650
                                .addClass('btn btn-xs')
1646
                                .text(_("Ignore holds and add to bundle"))
1651
                                .text(_("Ignore holds and add to bundle"))
1647
                                .on('click', function () {
1652
                                .on('click', function () {
1648
                                    addToBundle(url, { external_id: barcode, ignore_holds: true });
1653
                                    addToBundle(url, { external_id: barcode, ignore_holds: true, marc_link: marc_link });
1649
                                });
1654
                                });
1650
                              $('#addResult')
1655
                              $('#addResult')
1651
                                .empty()
1656
                                .empty()
Lines 1676-1682 Link Here
1676
                  event.preventDefault();
1681
                  event.preventDefault();
1677
1682
1678
                  const url = this.action;
1683
                  const url = this.action;
1679
                  const data = { external_id: this.elements.external_id.value };
1684
                  const data = { external_id: this.elements.external_id.value, marc_link: this.elements.bundle_link.checked };
1680
1685
1681
                  addToBundle(url, data);
1686
                  addToBundle(url, data);
1682
            });
1687
            });
1683
- 

Return to bug 29560