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

(-)a/Koha/REST/V1/Items.pm (+5 lines)
Lines 338-343 sub add_to_bundle { Link Here
338
        );
338
        );
339
    }
339
    }
340
340
341
    my $add_link = $c->validation->param('body')->{'marc_link'} // 0;
341
    return try {
342
    return try {
342
        my $options = {
343
        my $options = {
343
            force_checkin => $body->{force_checkin},
344
            force_checkin => $body->{force_checkin},
Lines 345-350 sub add_to_bundle { Link Here
345
        };
346
        };
346
347
347
        my $link = $item->add_to_bundle($bundle_item, $options);
348
        my $link = $item->add_to_bundle($bundle_item, $options);
349
        if ($add_link) {
350
            $bundle_item->biblio->link_marc_host(
351
                { biblionumber => $item->biblio->biblionumber } );
352
        }
348
        return $c->render(
353
        return $c->render(
349
            status  => 201,
354
            status  => 201,
350
            openapi => $bundle_item
355
            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 1301-1306 Link Here
1301
                                    <input type="text" id="external_id" name="external_id" required="required">
1301
                                    <input type="text" id="external_id" name="external_id" required="required">
1302
                                    <span class="required">Required</span>
1302
                                    <span class="required">Required</span>
1303
                                </li>
1303
                                </li>
1304
                                <li>
1305
                                    <label for="bundle_link">Add MARC link: </label>
1306
                                    <input type="checkbox" name="bundle_link"/>
1307
                                </li>
1304
                            </ol>
1308
                            </ol>
1305
                        </fieldset>
1309
                        </fieldset>
1306
                    </div>
1310
                    </div>
Lines 1980-1985 Link Here
1980
                  });
1984
                  });
1981
1985
1982
                  const barcode = data.external_id;
1986
                  const barcode = data.external_id;
1987
                  const marc_link = data.marc_link;
1983
1988
1984
                  /* Report the results */
1989
                  /* Report the results */
1985
                  posting.done(function(data) {
1990
                  posting.done(function(data) {
Lines 1999-2005 Link Here
1999
                                .addClass('btn btn-xs')
2004
                                .addClass('btn btn-xs')
2000
                                .text(_("Check in and add to bundle"))
2005
                                .text(_("Check in and add to bundle"))
2001
                                .on('click', function () {
2006
                                .on('click', function () {
2002
                                    addToBundle(url, { external_id: barcode, force_checkin: true });
2007
                                    addToBundle(url, { external_id: barcode, force_checkin: true, marc_link: marc_link });
2003
                                });
2008
                                });
2004
                              $('#addResult')
2009
                              $('#addResult')
2005
                                .empty()
2010
                                .empty()
Lines 2016-2022 Link Here
2016
                                .addClass('btn btn-xs')
2021
                                .addClass('btn btn-xs')
2017
                                .text(_("Ignore holds and add to bundle"))
2022
                                .text(_("Ignore holds and add to bundle"))
2018
                                .on('click', function () {
2023
                                .on('click', function () {
2019
                                    addToBundle(url, { external_id: barcode, ignore_holds: true });
2024
                                    addToBundle(url, { external_id: barcode, ignore_holds: true, marc_link: marc_link });
2020
                                });
2025
                                });
2021
                              $('#addResult')
2026
                              $('#addResult')
2022
                                .empty()
2027
                                .empty()
Lines 2047-2053 Link Here
2047
                  event.preventDefault();
2052
                  event.preventDefault();
2048
2053
2049
                  const url = this.action;
2054
                  const url = this.action;
2050
                  const data = { external_id: this.elements.external_id.value };
2055
                  const data = { external_id: this.elements.external_id.value, marc_link: this.elements.bundle_link.checked };
2051
2056
2052
                  addToBundle(url, data);
2057
                  addToBundle(url, data);
2053
            });
2058
            });
2054
- 

Return to bug 29560