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 ($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 41-46 use Koha::BiblioFrameworks; Link Here
41
use Koha::Biblios;
41
use Koha::Biblios;
42
use Koha::Items;
42
use Koha::Items;
43
use Koha::MetadataRecord;
43
use Koha::MetadataRecord;
44
use Koha::Plugins;
44
45
45
my $input = CGI->new;
46
my $input = CGI->new;
46
my @biblionumbers = $input->multi_param('biblionumber');
47
my @biblionumbers = $input->multi_param('biblionumber');
Lines 69-74 if ($merge) { Link Here
69
    my $ref_biblionumber = $input->param('ref_biblionumber');
70
    my $ref_biblionumber = $input->param('ref_biblionumber');
70
    @biblionumbers = grep { $_ != $ref_biblionumber } @biblionumbers;
71
    @biblionumbers = grep { $_ != $ref_biblionumber } @biblionumbers;
71
72
73
    my $biblio = Koha::Biblios->find($ref_biblionumber);
74
    Koha::Plugins->call(
75
        'before_biblio_action',
76
        {
77
            action            => 'merge',
78
            biblio            => $biblio,
79
            biblio_id         => $ref_biblionumber,
80
            record            => $record,
81
            merged_biblio_ids => \@biblionumbers
82
        }
83
    );
84
72
    # prepare report
85
    # prepare report
73
    my @report_records;
86
    my @report_records;
74
    my $report_fields_str = $input->param('report_fields');
87
    my $report_fields_str = $input->param('report_fields');
Lines 93-99 if ($merge) { Link Here
93
    ModBiblio($record, $ref_biblionumber, $frameworkcode);
106
    ModBiblio($record, $ref_biblionumber, $frameworkcode);
94
107
95
    # Moving items and article requests from the other record to the reference record
108
    # Moving items and article requests from the other record to the reference record
96
    my $biblio = Koha::Biblios->find($ref_biblionumber);
109
    $biblio = Koha::Biblios->find($ref_biblionumber);
97
    foreach my $biblionumber (@biblionumbers) {
110
    foreach my $biblionumber (@biblionumbers) {
98
        my $from_biblio = Koha::Biblios->find($biblionumber);
111
        my $from_biblio = Koha::Biblios->find($biblionumber);
99
        $from_biblio->items->move_to_biblio($biblio);
112
        $from_biblio->items->move_to_biblio($biblio);
100
- 

Return to bug 29392