Bugzilla – Attachment 55543 Details for
Bug 15869
Change framework on overlay
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15869 - change framework on overlay
Bug-15869---change-framework-on-overlay.patch (text/plain), 4.31 KB, created by
Nick Clemens (kidclamp)
on 2016-09-13 15:28:35 UTC
(
hide
)
Description:
Bug 15869 - change framework on overlay
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2016-09-13 15:28:35 UTC
Size:
4.31 KB
patch
obsolete
>From 55440916aee5af02760007fc305e17abad472ff0 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@bywatersolutions.com> >Date: Tue, 13 Sep 2016 15:23:50 +0000 >Subject: [PATCH] Bug 15869 - change framework on overlay > >This patch allows for selection of framework to use when overlaying >records - by default it is set to keep the initial framework > >To test: > 1 - Create some records using one framework > 2 - Export the records > 3 - Edit the records to add fields not in original framework > 4 - Stage records using a rule that will find matches > 5 - Import > 6 - Note records contain new fields on display, but they are lost on edit > 7 - Apply patch > 8 - Stage records again > 9 - Select a framework that contains the new fields on import >10 - Import records >11 - Note records now use selected framework and are displayed/edited >correctly >--- > C4/ImportBatch.pm | 5 +++-- > .../intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt | 9 +++++++++ > tools/manage-marc-import.pl | 7 ++++--- > 3 files changed, 16 insertions(+), 5 deletions(-) > >diff --git a/C4/ImportBatch.pm b/C4/ImportBatch.pm >index 88d670d..fc2c6bde 100644 >--- a/C4/ImportBatch.pm >+++ b/C4/ImportBatch.pm >@@ -567,6 +567,7 @@ sub BatchFindDuplicates { > sub BatchCommitRecords { > my $batch_id = shift; > my $framework = shift; >+ my $overlay_framework = shift; > > # optional callback to monitor status > # of job >@@ -673,8 +674,8 @@ sub BatchCommitRecords { > $old_marc->delete_field($item_field); > } > $oldxml = $old_marc->as_xml($marc_type); >- >- ModBiblio($marc_record, $recordid, $oldbiblio->{'frameworkcode'}); >+ if ($overlay_framework == '_USE_ORIG_') { $overlay_framework = $oldbiblio->{'frameworkcode'}; } >+ ModBiblio($marc_record, $recordid, $overlay_framework); > $query = "UPDATE import_biblios SET matched_biblionumber = ? WHERE import_record_id = ?"; > > if ($item_result eq 'create_new' || $item_result eq 'replace') { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt >index f89ec73..5adffb6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/manage-marc-import.tt >@@ -364,6 +364,15 @@ $(document).ready(function(){ > <option value="[% framework.value %]">[% framework.label %]</option> > [% END %] > </select> >+ <br/> >+ When replacing records use this framework: >+ <select name="overlay_framework" id="overlay_frameworks"> >+ <option value="_USE_ORIG_">Keep original framework</option> >+ <option value="">Default</option> >+ [% FOREACH framework IN frameworks %] >+ <option value="[% framework.value %]">[% framework.label %]</option> >+ [% END %] >+ </select> > [% END %] > </fieldset> > </form> >diff --git a/tools/manage-marc-import.pl b/tools/manage-marc-import.pl >index 83abc91..5c61fcc 100755 >--- a/tools/manage-marc-import.pl >+++ b/tools/manage-marc-import.pl >@@ -106,7 +106,8 @@ if ($op eq "") { > add_saved_job_results_to_template($template, $completedJobID); > } else { > my $framework = $input->param('framework'); >- commit_batch($template, $import_batch_id, $framework); >+ my $overlay_framework = $input->param('overlay_framework'); >+ commit_batch($template, $import_batch_id, $framework, $overlay_framework); > } > import_records_list($template, $import_batch_id, $offset, $results_per_page); > } elsif ($op eq "revert-batch") { >@@ -237,7 +238,7 @@ sub import_batches_list { > } > > sub commit_batch { >- my ($template, $import_batch_id, $framework) = @_; >+ my ($template, $import_batch_id, $framework, $overlay_framework) = @_; > > my $job = undef; > $dbh->{AutoCommit} = 0; >@@ -247,7 +248,7 @@ sub commit_batch { > $callback = progress_callback($job, $dbh); > } > my ($num_added, $num_updated, $num_items_added, $num_items_replaced, $num_items_errored, $num_ignored) = >- BatchCommitRecords($import_batch_id, $framework, 50, $callback); >+ BatchCommitRecords($import_batch_id, $framework, $overlay_framework, 50, $callback); > $dbh->commit(); > > my $results = { >-- >2.1.4
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 15869
:
55543
|
70800
|
77018
|
140857
|
140858
|
142257
|
142258
|
143033
|
145271
|
145272
|
145273
|
145274
|
145406