Lines 57-62
use Koha::Libraries;
Link Here
|
57 |
use Koha::BiblioFrameworks; |
57 |
use Koha::BiblioFrameworks; |
58 |
use Koha::Patrons; |
58 |
use Koha::Patrons; |
59 |
use Koha::UI::Form::Builder::Biblio; |
59 |
use Koha::UI::Form::Builder::Biblio; |
|
|
60 |
use Koha::Util::Misc; |
60 |
|
61 |
|
61 |
use MARC::File::USMARC; |
62 |
use MARC::File::USMARC; |
62 |
use MARC::File::XML; |
63 |
use MARC::File::XML; |
Lines 603-608
my (
Link Here
|
603 |
$biblioitemnumber |
604 |
$biblioitemnumber |
604 |
); |
605 |
); |
605 |
|
606 |
|
|
|
607 |
my $digest; |
606 |
if ( $biblio && !$breedingid ) { |
608 |
if ( $biblio && !$breedingid ) { |
607 |
eval { $record = $biblio->metadata->record }; |
609 |
eval { $record = $biblio->metadata->record }; |
608 |
if ($@) { |
610 |
if ($@) { |
Lines 611-616
if ( $biblio && !$breedingid ) {
Link Here
|
611 |
$record = $biblio->metadata->record_strip_nonxml; |
613 |
$record = $biblio->metadata->record_strip_nonxml; |
612 |
$template->param( INVALID_METADATA => $exception ); |
614 |
$template->param( INVALID_METADATA => $exception ); |
613 |
} |
615 |
} |
|
|
616 |
$digest = Koha::Util::Misc::digest($record) if $record; |
614 |
} |
617 |
} |
615 |
if ($breedingid) { |
618 |
if ($breedingid) { |
616 |
( $record, $encoding ) = MARCfindbreeding( $breedingid ) ; |
619 |
( $record, $encoding ) = MARCfindbreeding( $breedingid ) ; |
Lines 701-711
if ( $op eq "cud-addbiblio" ) {
Link Here
|
701 |
( $duplicatebiblionumber, $duplicatetitle ) = FindDuplicate($record); |
704 |
( $duplicatebiblionumber, $duplicatetitle ) = FindDuplicate($record); |
702 |
} |
705 |
} |
703 |
my $confirm_not_duplicate = $input->param('confirm_not_duplicate'); |
706 |
my $confirm_not_duplicate = $input->param('confirm_not_duplicate'); |
|
|
707 |
my $digest_orig = $input->param('digest'); |
704 |
# it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate) |
708 |
# it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate) |
705 |
if ( !$duplicatebiblionumber or $confirm_not_duplicate ) { |
709 |
if ( !$duplicatebiblionumber or $confirm_not_duplicate ) { |
706 |
my $oldbibitemnum; |
710 |
my $oldbibitemnum; |
707 |
if ( $is_a_modif ) { |
711 |
if ( $is_a_modif ) { |
708 |
ModBiblio( |
712 |
my $mod_biblio_result = ModBiblio( |
709 |
$record, |
713 |
$record, |
710 |
$biblionumber, |
714 |
$biblionumber, |
711 |
$frameworkcode, |
715 |
$frameworkcode, |
Lines 714-722
if ( $op eq "cud-addbiblio" ) {
Link Here
|
714 |
source => $z3950 ? 'z3950' : 'intranet', |
718 |
source => $z3950 ? 'z3950' : 'intranet', |
715 |
categorycode => $logged_in_patron->categorycode, |
719 |
categorycode => $logged_in_patron->categorycode, |
716 |
userid => $logged_in_patron->userid, |
720 |
userid => $logged_in_patron->userid, |
717 |
} |
721 |
}, |
|
|
722 |
original_digest => $digest_orig, |
718 |
} |
723 |
} |
719 |
); |
724 |
); |
|
|
725 |
|
726 |
# in case of unsuccessful record modification let's redirect to merge |
727 |
if ( $mod_biblio_result == -1 ) { |
728 |
( $template, undef, undef ) = get_template_and_user( |
729 |
{ |
730 |
template_name => "cataloguing/merge.tt", |
731 |
query => $input, |
732 |
type => "intranet", |
733 |
flagsrequired => { editcatalogue => 'edit_catalogue' }, |
734 |
} |
735 |
); |
736 |
|
737 |
my ( $records, $framework_database ) = Koha::Util::Misc::prepare_mid_air_collision_merge({ biblionumber => $biblionumber, modified_record => $record }); |
738 |
|
739 |
my ($biblionumbertag) = GetMarcFromKohaField('biblio.biblionumber'); |
740 |
|
741 |
# Parameters |
742 |
$template->param( |
743 |
ref_biblionumber => $biblionumber, |
744 |
records => $records, |
745 |
ref_record => $records->[0], |
746 |
framework => $framework_database, |
747 |
biblionumbertag => $biblionumbertag, |
748 |
mid_air_collision => 1, |
749 |
digest => Koha::Util::Misc::digest( $records->[0]->{record} ), |
750 |
); |
751 |
|
752 |
output_html_with_http_headers $input, $cookie, $template->output; |
753 |
exit; |
754 |
} |
720 |
} |
755 |
} |
721 |
else { |
756 |
else { |
722 |
( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode ); |
757 |
( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode ); |
Lines 845-857
elsif ( $op eq "cud-delete" ) {
Link Here
|
845 |
build_tabs( $template, $record, $dbh, $encoding,$input ); |
880 |
build_tabs( $template, $record, $dbh, $encoding,$input ); |
846 |
$template->param( |
881 |
$template->param( |
847 |
biblionumber => $biblionumber, |
882 |
biblionumber => $biblionumber, |
848 |
biblionumbertagfield => $biblionumbertagfield, |
883 |
biblionumbertagfield => $biblionumbertagfield, |
849 |
biblionumbertagsubfield => $biblionumbertagsubfield, |
884 |
biblionumbertagsubfield => $biblionumbertagsubfield, |
850 |
biblioitemnumtagfield => $biblioitemnumtagfield, |
885 |
biblioitemnumtagfield => $biblioitemnumtagfield, |
851 |
biblioitemnumtagsubfield => $biblioitemnumtagsubfield, |
886 |
biblioitemnumtagsubfield => $biblioitemnumtagsubfield, |
852 |
biblioitemnumber => $biblioitemnumber, |
887 |
biblioitemnumber => $biblioitemnumber, |
853 |
hostbiblionumber => $hostbiblionumber, |
888 |
hostbiblionumber => $hostbiblionumber, |
854 |
hostitemnumber => $hostitemnumber |
889 |
hostitemnumber => $hostitemnumber, |
|
|
890 |
digest => $digest, |
855 |
); |
891 |
); |
856 |
} |
892 |
} |
857 |
|
893 |
|