From e3c59a0587b00015362ecf4b89372a289666afa4 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Wed, 6 Jan 2016 19:11:27 +0100 Subject: [PATCH] Bug 15358: Fix authorities merge Bug 8064 (Merge several biblio records) change some code used in both biblios and authorities merge tool without updating the authorities merge tool. This patch fixes that. Signed-off-by: Josef Moravec Signed-off-by: Jonathan Druart Signed-off-by: Julian Maurice --- authorities/merge.pl | 20 +++++++++++++++---- cataloguing/merge.pl | 2 +- .../prog/en/includes/merge-record.inc | 20 +++++++++---------- .../prog/en/modules/authorities/merge.tt | 8 ++++---- 4 files changed, 31 insertions(+), 19 deletions(-) diff --git a/authorities/merge.pl b/authorities/merge.pl index 45785ee8f6..49563355d7 100755 --- a/authorities/merge.pl +++ b/authorities/merge.pl @@ -133,15 +133,27 @@ else { # Creating a loop for display - my @record1 = $recordObj1->createMergeHash($tagslib); - my @record2 = $recordObj2->createMergeHash($tagslib); + my @records = ( + { + recordid => $mergereference, + record => $recordObj1->record, + frameworkcode => $recordObj1->authtype, + display => $recordObj1->createMergeHash($tagslib), + reference => 1, + }, + { + recordid => $notreference, + record => $recordObj2->record, + frameworkcode => $recordObj2->authtype, + display => $recordObj2->createMergeHash($tagslib), + }, + ); # Parameters $template->param( recordid1 => $mergereference, recordid2 => $notreference, - record1 => @record1, - record2 => @record2, + records => \@records, framework => $framework, ); } diff --git a/cataloguing/merge.pl b/cataloguing/merge.pl index a882daa05c..fc96d3cfcb 100755 --- a/cataloguing/merge.pl +++ b/cataloguing/merge.pl @@ -203,7 +203,7 @@ if ($merge) { my $frameworkcode = GetFrameworkCode($biblionumber); my $recordObj = new Koha::MetadataRecord({'record' => $marcrecord, schema => $marcflavour}); my $record = { - biblionumber => $biblionumber, + recordid => $biblionumber, record => $marcrecord, frameworkcode => $frameworkcode, display => $recordObj->createMergeHash($tagslib), diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/merge-record.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/merge-record.inc index 111252afd0..df79d8e691 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/merge-record.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/merge-record.inc @@ -1,16 +1,16 @@ [% BLOCK sourcetab %] -
+
-
    +
      [% FOREACH field IN record.display %] [% IF field.tag != biblionumbertag %]
    • [% IF (tabrecord.reference) %] - + [% ELSE %] - + [% END %] - + @@ -25,11 +25,11 @@ [% FOREACH subfield IN field.subfield %]
    • [% IF (tabrecord.reference) %] - + [% ELSE %] - + [% END %] - +
    • @@ -50,8 +50,8 @@
        [% FOREACH record IN sourcerecords %]
      • - - [% record.biblionumber %] + + [% record.recordid %] [% IF record.reference %](ref)[% END %]
      • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt index 520b9cd508..3203c2664d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/authorities/merge.tt @@ -15,15 +15,15 @@ div#result { margin-top: 1em; } // When submiting the form function mergeformsubmit() { - $("ul#ulrecord1").remove(); - $("ul#ulrecord2").remove(); -} + $('#tabs').remove(); + } $(document).ready(function(){ // Getting marc structure via ajax tagslib = []; $.getJSON("/cgi-bin/koha/authorities/merge_ajax.pl", {frameworkcode : "[% framework %]" }, function(json) { tagslib = json; + rebuild_target($("#tabs"), $("#resultul")); }); $('.preview-merge-reference').click(function (ev) { @@ -129,7 +129,7 @@ function changeFramework(fw) {
        -[% PROCESS mergesource %] +[% PROCESS mergesource sourcerecords=records %]
        [% PROCESS mergetarget %] -- 2.39.5