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 |
- |
|
|