Bugzilla – Attachment 140094 Details for
Bug 27981
Add option to automatically set the 001 control number to the biblionumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27981: Adjust imported records, svc/import_bibs, records from Z3950
Bug-27981-Adjust-imported-records-svcimportbibs-re.patch (text/plain), 3.33 KB, created by
Andrii Nugged
on 2022-09-02 09:44:00 UTC
(
hide
)
Description:
Bug 27981: Adjust imported records, svc/import_bibs, records from Z3950
Filename:
MIME Type:
Creator:
Andrii Nugged
Created:
2022-09-02 09:44:00 UTC
Size:
3.33 KB
patch
obsolete
>From 5578fa2f6d4a29dc638553070f3bf0d2f6d80189 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 31 Aug 2021 12:59:56 +0000 >Subject: [PATCH] Bug 27981: Adjust imported records, svc/import_bibs, records > from Z3950 > >Signed-off-by: Thomas Klausner <domm@plix.at> > >Signed-off-by: Andrew Nugged <nugged@gmail.com> >--- > C4/ImportBatch.pm | 4 ++++ > cataloguing/addbiblio.pl | 4 ++++ > koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc | 2 ++ > svc/import_bib | 4 ++++ > 4 files changed, 14 insertions(+) > >diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm >index ee76020fba..3f469f6a44 100644 >--- a/C4/ImportBatch.pm >+++ b/C4/ImportBatch.pm >@@ -584,6 +584,10 @@ sub BatchCommitRecords { > foreach my $item_field ($marc_record->field($item_tag)) { > $marc_record->delete_field($item_field); > } >+ if(C4::Context->preference('autoControlNumber') eq 'biblionumber'){ >+ my @control_num = $marc_record->field('001'); >+ $marc_record->delete_fields(@control_num); >+ } > } > > my ($record_result, $item_result, $record_match) = >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index b73d973849..aba83e7b37 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -82,6 +82,10 @@ sub MARCfindbreeding { > # remove the - in isbn, koha store isbn without any - > if ($marc) { > my $record = MARC::Record->new_from_usmarc($marc); >+ if(C4::Context->preference('autoControlNumber') eq 'biblionumber'){ >+ my @control_num = $record->field('001'); >+ $record->delete_fields(@control_num); >+ } > my ($isbnfield,$isbnsubfield) = GetMarcFromKohaField( 'biblioitems.isbn' ); > if ( $record->field($isbnfield) ) { > foreach my $field ( $record->field($isbnfield) ) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc >index 4fe7515f9e..52f4598888 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-ui.inc >@@ -412,6 +412,8 @@ require( [ 'koha-backend', 'search', 'macros', 'marc-editor', 'marc-record', 'pr > > backends[ parts[0] ].get( parts[1], function( record ) { > if ( !record.error ) { >+ var remove_control_num = [% IF Koha.Preference('autoControlNumber') == 'OFF' %] 0 [% ELSE %] 1 [% END %]; >+ if( remove_control_num ){ record.removeField("001"); } > editor.displayRecord( record ); > editor.focus(); > } >diff --git a/svc/import_bib b/svc/import_bib >index ce46454b20..ac5253f2d0 100755 >--- a/svc/import_bib >+++ b/svc/import_bib >@@ -79,6 +79,10 @@ sub import_bib { > $result->{'error'} = $@; > return $result; > } >+ if(C4::Context->preference('autoControlNumber') eq 'biblionumber'){ >+ my @control_num = $record->field('001'); >+ $marc_record->delete_fields(@control_num); >+ } > > my $import_record_id = AddBiblioToBatch($batch_id, 0, $marc_record, "utf8", 1); > my @import_items_ids = AddItemsToImportBiblio($batch_id, $import_record_id, $marc_record, 'UPDATE COUNTS'); >-- >2.37.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 27981
:
118461
|
118513
|
119704
|
119705
|
119717
|
121805
|
122280
|
122301
|
122344
|
122356
|
122672
|
122674
|
122675
|
124279
|
124280
|
124281
|
128223
|
128224
|
128225
|
132034
|
132035
|
132036
|
134536
|
134537
|
134538
|
134539
|
136022
|
140092
|
140093
| 140094 |
140095
|
140096
|
140097
|
140502