X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=cataloguing%2Fmerge.pl;h=e3ee725701f79e46cbbac21164a2c8f851b771d8;hb=c0234dd9b9649063acf2617fecf5c6efda38a532;hp=eaf0c9763af99497e0548388c2fbe43bb15a0d31;hpb=5278aa0ca4bb5110741b792b527725280a3ee902;p=koha_gimpoz diff --git a/cataloguing/merge.pl b/cataloguing/merge.pl index eaf0c9763a..e3ee725701 100755 --- a/cataloguing/merge.pl +++ b/cataloguing/merge.pl @@ -2,6 +2,7 @@ # Copyright 2009 BibLibre +# Parts Copyright Catalyst IT 2011 # # This file is part of Koha. # @@ -26,6 +27,7 @@ use C4::Auth; use C4::Items; use C4::Biblio; use C4::Serials; +use C4::Reserves qw/MergeHolds/; my $input = new CGI; my @biblionumber = $input->param('biblionumber'); @@ -48,12 +50,11 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( #------------------------ 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'); @@ -101,6 +102,8 @@ if ($merge) { # Deleting the other record if (scalar(@errors) == 0) { + # Move holds + MergeHolds($dbh,$tobiblio,$frombiblio); my $error = DelBiblio($frombiblio); push @errors, $error if ($error); } @@ -109,11 +112,11 @@ if ($merge) { my @errors_loop = map{{error => $_}}@errors; # Parameters - $template->param({ + $template->param( errors => \@errors_loop, result => 1, biblio1 => $input->param('biblio1') - }); + ); #------------------------- @@ -129,13 +132,13 @@ if ($merge) { # 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) { @@ -165,7 +168,7 @@ if ($merge) { my @errors_loop = map{{error => $_}}@errors; # Parameters - $template->param({ + $template->param( errors => \@errors_loop, biblio1 => $mergereference, biblio2 => $notreference, @@ -173,7 +176,7 @@ if ($merge) { record1 => @record1, record2 => @record2, framework => $framework - }); + ); } } output_html_with_http_headers $input, $cookie, $template->output; @@ -252,3 +255,4 @@ sub createKey(){ } +