# Copyright 2009 BibLibre
+# Parts Copyright Catalyst IT 2011
#
# This file is part of Koha.
#
use C4::Items;
use C4::Biblio;
use C4::Serials;
+use C4::Reserves qw/MergeHolds/;
my $input = new CGI;
my @biblionumber = $input->param('biblionumber');
#------------------------
if ($merge) {
- my @params = $input->param();
my $dbh = C4::Context->dbh;
my $sth;
# Creating a new record from the html code
- my $record = TransformHtmlToMarc( \@params , $input );
+ my $record = TransformHtmlToMarc( $input );
my $tobiblio = $input->param('biblio1');
my $frombiblio = $input->param('biblio2');
# Deleting the other record
if (scalar(@errors) == 0) {
+ # Move holds
+ MergeHolds($dbh,$tobiblio,$frombiblio);
my $error = DelBiblio($frombiblio);
push @errors, $error if ($error);
}
my @errors_loop = map{{error => $_}}@errors;
# Parameters
- $template->param({
+ $template->param(
errors => \@errors_loop,
result => 1,
biblio1 => $input->param('biblio1')
- });
+ );
#-------------------------
# Ask the user to choose which record will be the kept
if (not $mergereference) {
- $template->param({
+ $template->param(
choosereference => 1,
biblio1 => $biblionumber[0],
biblio2 => $biblionumber[1],
title1 => $data1->{'title'},
title2 => $data2->{'title'}
- });
+ );
} else {
if (scalar(@biblionumber) != 2) {
my @errors_loop = map{{error => $_}}@errors;
# Parameters
- $template->param({
+ $template->param(
errors => \@errors_loop,
biblio1 => $mergereference,
biblio2 => $notreference,
record1 => @record1,
record2 => @record2,
framework => $framework
- });
+ );
}
}
output_html_with_http_headers $input, $cookie, $template->output;
}
+