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

(-)a/Koha/REST/V1/Items.pm (+5 lines)
Lines 307-312 sub add_to_bundle { Link Here
307
        );
307
        );
308
    }
308
    }
309
309
310
    my $add_link = $c->validation->param('body')->{'marc_link'} // 0;
310
    return try {
311
    return try {
311
        my $options = {
312
        my $options = {
312
            force_checkin => $body->{force_checkin},
313
            force_checkin => $body->{force_checkin},
Lines 314-319 sub add_to_bundle { Link Here
314
        };
315
        };
315
316
316
        my $link = $item->add_to_bundle($bundle_item, $options);
317
        my $link = $item->add_to_bundle($bundle_item, $options);
318
        if ($add_link) {
319
            $bundle_item->biblio->link_marc_host(
320
                { biblionumber => $item->biblio->biblionumber } );
321
        }
317
        return $c->render(
322
        return $c->render(
318
            status  => 201,
323
            status  => 201,
319
            openapi => $bundle_item
324
            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 1299-1304 Link Here
1299
                                    <input type="text" id="external_id" name="external_id" required="required">
1299
                                    <input type="text" id="external_id" name="external_id" required="required">
1300
                                    <span class="required">Required</span>
1300
                                    <span class="required">Required</span>
1301
                                </li>
1301
                                </li>
1302
                                <li>
1303
                                    <label for="bundle_link">Add MARC link: </label>
1304
                                    <input type="checkbox" name="bundle_link"/>
1305
                                </li>
1302
                            </ol>
1306
                            </ol>
1303
                        </fieldset>
1307
                        </fieldset>
1304
                    </div>
1308
                    </div>
Lines 1974-1979 Link Here
1974
                  });
1978
                  });
1975
1979
1976
                  const barcode = data.external_id;
1980
                  const barcode = data.external_id;
1981
                  const marc_link = data.marc_link;
1977
1982
1978
                  /* Report the results */
1983
                  /* Report the results */
1979
                  posting.done(function(data) {
1984
                  posting.done(function(data) {
Lines 1993-1999 Link Here
1993
                                .addClass('btn btn-xs')
1998
                                .addClass('btn btn-xs')
1994
                                .text(_("Check in and add to bundle"))
1999
                                .text(_("Check in and add to bundle"))
1995
                                .on('click', function () {
2000
                                .on('click', function () {
1996
                                    addToBundle(url, { external_id: barcode, force_checkin: true });
2001
                                    addToBundle(url, { external_id: barcode, force_checkin: true, marc_link: marc_link });
1997
                                });
2002
                                });
1998
                              $('#addResult')
2003
                              $('#addResult')
1999
                                .empty()
2004
                                .empty()
Lines 2010-2016 Link Here
2010
                                .addClass('btn btn-xs')
2015
                                .addClass('btn btn-xs')
2011
                                .text(_("Ignore holds and add to bundle"))
2016
                                .text(_("Ignore holds and add to bundle"))
2012
                                .on('click', function () {
2017
                                .on('click', function () {
2013
                                    addToBundle(url, { external_id: barcode, ignore_holds: true });
2018
                                    addToBundle(url, { external_id: barcode, ignore_holds: true, marc_link: marc_link });
2014
                                });
2019
                                });
2015
                              $('#addResult')
2020
                              $('#addResult')
2016
                                .empty()
2021
                                .empty()
Lines 2041-2047 Link Here
2041
                  event.preventDefault();
2046
                  event.preventDefault();
2042
2047
2043
                  const url = this.action;
2048
                  const url = this.action;
2044
                  const data = { external_id: this.elements.external_id.value };
2049
                  const data = { external_id: this.elements.external_id.value, marc_link: this.elements.bundle_link.checked };
2045
2050
2046
                  addToBundle(url, data);
2051
                  addToBundle(url, data);
2047
            });
2052
            });
2048
- 

Return to bug 29560