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

(-)a/authorities/merge.pl (+14 lines)
Lines 24-32 use C4::Auth qw( get_template_and_user ); Link Here
24
use C4::AuthoritiesMarc qw( GetAuthority ModAuthority DelAuthority GetTagsLabels merge );
24
use C4::AuthoritiesMarc qw( GetAuthority ModAuthority DelAuthority GetTagsLabels merge );
25
use C4::Biblio qw( TransformHtmlToMarc );
25
use C4::Biblio qw( TransformHtmlToMarc );
26
26
27
use Koha::Authorities;
27
use Koha::Authority::MergeRequests;
28
use Koha::Authority::MergeRequests;
28
use Koha::Authority::Types;
29
use Koha::Authority::Types;
29
use Koha::MetadataRecord::Authority;
30
use Koha::MetadataRecord::Authority;
31
use Koha::Plugins;
30
32
31
my $input  = CGI->new;
33
my $input  = CGI->new;
32
my @authid = $input->multi_param('authid');
34
my @authid = $input->multi_param('authid');
Lines 73-78 if ($op eq 'cud-merge') { Link Here
73
        $record->leader( $authrec->leader() );
75
        $record->leader( $authrec->leader() );
74
    }
76
    }
75
77
78
    my $authority = Koha::Authorities->find($recordid1);
79
    Koha::Plugins->call(
80
        'before_authority_action',
81
        {
82
            action               => 'merge',
83
            authority            => $authority,
84
            authority_id         => $recordid1,
85
            record               => $record,
86
            merged_authority_ids => [$recordid2],
87
        }
88
    );
89
76
    # Modifying the reference record
90
    # Modifying the reference record
77
    # This triggers a merge for the biblios attached to $recordid1
91
    # This triggers a merge for the biblios attached to $recordid1
78
    ModAuthority( $recordid1, $record, $typecode );
92
    ModAuthority( $recordid1, $record, $typecode );
(-)a/cataloguing/merge.pl (-2 / +14 lines)
Lines 40-45 use Koha::BiblioFrameworks; Link Here
40
use Koha::Biblios;
40
use Koha::Biblios;
41
use Koha::Items;
41
use Koha::Items;
42
use Koha::MetadataRecord;
42
use Koha::MetadataRecord;
43
use Koha::Plugins;
43
44
44
my $input = CGI->new;
45
my $input = CGI->new;
45
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
46
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Lines 67-72 if ($op eq 'cud-merge') { Link Here
67
    my $ref_biblionumber = $input->param('ref_biblionumber');
68
    my $ref_biblionumber = $input->param('ref_biblionumber');
68
    @biblionumbers = grep { $_ != $ref_biblionumber } @biblionumbers;
69
    @biblionumbers = grep { $_ != $ref_biblionumber } @biblionumbers;
69
70
71
    my $biblio = Koha::Biblios->find($ref_biblionumber);
72
    Koha::Plugins->call(
73
        'before_biblio_action',
74
        {
75
            action            => 'merge',
76
            biblio            => $biblio,
77
            biblio_id         => $ref_biblionumber,
78
            record            => $record,
79
            merged_biblio_ids => \@biblionumbers
80
        }
81
    );
82
70
    # prepare report
83
    # prepare report
71
    my @report_records;
84
    my @report_records;
72
    my $report_fields_str = $input->param('report_fields');
85
    my $report_fields_str = $input->param('report_fields');
Lines 83-89 if ($op eq 'cud-merge') { Link Here
83
    }
96
    }
84
97
85
    # Rewriting the leader
98
    # Rewriting the leader
86
    my $biblio = Koha::Biblios->find($ref_biblionumber);
99
    $biblio = Koha::Biblios->find($ref_biblionumber);
87
    $record->leader($biblio->metadata->record->leader());
100
    $record->leader($biblio->metadata->record->leader());
88
    #Take new framework code
101
    #Take new framework code
89
    my $frameworkcode = $input->param('frameworkcode');
102
    my $frameworkcode = $input->param('frameworkcode');
90
- 

Return to bug 29392