Bugzilla – Attachment 168817 Details for
Bug 29560
Add option to create MARC links when adding items to bundles
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29560: Add option to create MARC Links when bundling items
Bug-29560-Add-option-to-create-MARC-Links-when-bun.patch (text/plain), 4.65 KB, created by
Martin Renvoize (ashimema)
on 2024-07-11 13:18:08 UTC
(
hide
)
Description:
Bug 29560: Add option to create MARC Links when bundling items
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2024-07-11 13:18:08 UTC
Size:
4.65 KB
patch
obsolete
>From d4a75fcecca81f1ad28ed78ba78ab49adfbcef27 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Wed, 18 May 2022 08:30:48 +0100 >Subject: [PATCH] Bug 29560: Add option to create MARC Links when bundling > items > >This patch add a checkbox to the 'Add to bundle' modal allowing the user >to optionally add MARC links between the new child record and the >current biblio. For MARC21 this will result in a 773 pointing to the >host from the item record and for UNIMARC a 461 field will be added. > >Signed-off-by: Tuomas Kunttu <tuomas.kunttu@kouvola.fi> >--- > 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(-) > >diff --git a/Koha/REST/V1/Items.pm b/Koha/REST/V1/Items.pm >index 4d147ed1953..2612cf326ee 100644 >--- a/Koha/REST/V1/Items.pm >+++ b/Koha/REST/V1/Items.pm >@@ -316,6 +316,7 @@ sub add_to_bundle { > return $c->render_resource_not_found("Bundle item") > unless $bundle_item; > >+ my $add_link = $c->validation->param('body')->{'marc_link'} // 0; > return try { > my $options = { > force_checkin => $body->{force_checkin}, >@@ -323,6 +324,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 >diff --git a/api/v1/swagger/definitions/bundle_link.yaml b/api/v1/swagger/definitions/bundle_link.yaml >index b564d039ee6..82d042a16bc 100644 >--- a/api/v1/swagger/definitions/bundle_link.yaml >+++ b/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 >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 65e395e5085..dda8b2e028e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -969,6 +969,10 @@ > <input type="text" id="external_id" name="external_id" required="required"> > <span class="required">Required</span> > </li> >+ <li> >+ <label for="bundle_link">Add MARC link: </label> >+ <input type="checkbox" name="bundle_link"/> >+ </li> > </ol> > </fieldset> > </div> >@@ -1609,6 +1613,7 @@ > }); > > const barcode = data.external_id; >+ const marc_link = data.marc_link; > > /* Report the results */ > posting.done(function(data) { >@@ -1628,7 +1633,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() >@@ -1645,7 +1650,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() >@@ -1676,7 +1681,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); > }); >-- >2.45.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 29560
:
135090
|
135091
|
137509
|
137510
|
156299
|
156300
|
159081
|
159082
|
168720
|
168721
|
168722
|
168723
|
168816
|
168817
|
168818
|
168819
|
168820
|
168821
|
168822
|
168823
|
168824
|
168825
|
168885
|
168886
|
168887
|
168888
|
168889
|
168968