|
Lines 703-710
if ( $op eq "cud-addbiblio" ) {
Link Here
|
| 703 |
# it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate) |
703 |
# it is not a duplicate (determined either by Koha itself or by user checking it's not a duplicate) |
| 704 |
if ( !$duplicatebiblionumber or $confirm_not_duplicate ) { |
704 |
if ( !$duplicatebiblionumber or $confirm_not_duplicate ) { |
| 705 |
my $oldbibitemnum; |
705 |
my $oldbibitemnum; |
|
|
706 |
my @save_warnings; |
| 706 |
my $encode_error = try { |
707 |
my $encode_error = try { |
| 707 |
if ( $is_a_modif ) { |
708 |
if ($is_a_modif) { |
| 708 |
ModBiblio( |
709 |
ModBiblio( |
| 709 |
$record, |
710 |
$record, |
| 710 |
$biblionumber, |
711 |
$biblionumber, |
|
Lines 714-724
if ( $op eq "cud-addbiblio" ) {
Link Here
|
| 714 |
source => $z3950 ? 'z3950' : 'intranet', |
715 |
source => $z3950 ? 'z3950' : 'intranet', |
| 715 |
categorycode => $logged_in_patron->categorycode, |
716 |
categorycode => $logged_in_patron->categorycode, |
| 716 |
userid => $logged_in_patron->userid, |
717 |
userid => $logged_in_patron->userid, |
| 717 |
} |
718 |
}, |
|
|
719 |
warnings => \@save_warnings, |
| 718 |
} |
720 |
} |
| 719 |
); |
721 |
); |
| 720 |
} else { |
722 |
} else { |
| 721 |
( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode ); |
723 |
( $biblionumber, $oldbibitemnum ) = |
|
|
724 |
AddBiblio( $record, $frameworkcode, { warnings => \@save_warnings } ); |
| 722 |
} |
725 |
} |
| 723 |
return 0; |
726 |
return 0; |
| 724 |
} catch { |
727 |
} catch { |
|
Lines 730-770
if ( $op eq "cud-addbiblio" ) {
Link Here
|
| 730 |
} |
733 |
} |
| 731 |
return 1; |
734 |
return 1; |
| 732 |
}; |
735 |
}; |
| 733 |
if (!$encode_error && ($redirect eq "items" || ($mode ne "popup" && !$is_a_modif && $redirect ne "view" && $redirect ne "just_save"))){ |
736 |
|
| 734 |
if ($frameworkcode eq 'FA'){ |
737 |
my ($nonxml_stripped) = grep { $_->{type} eq 'nonxml_stripped' } @save_warnings; |
| 735 |
print $input->redirect( |
738 |
if ( $nonxml_stripped && !$encode_error ) { |
| 736 |
'/cgi-bin/koha/cataloguing/additem.pl?' |
739 |
$record = Koha::Biblios->find($biblionumber)->metadata->record; |
| 737 |
.'biblionumber='.$biblionumber |
740 |
build_tabs( $template, $record, $dbh, $encoding, $input ); |
| 738 |
.'&frameworkcode='.$frameworkcode |
741 |
$template->param( |
| 739 |
.'&circborrowernumber='.$fa_circborrowernumber |
742 |
biblionumber => $biblionumber, |
| 740 |
.'&branch='.$fa_branch |
743 |
popup => $mode, |
| 741 |
.'&barcode='.uri_escape_utf8($fa_barcode) |
744 |
frameworkcode => $frameworkcode, |
| 742 |
.'&stickyduedate='.$fa_stickyduedate |
745 |
itemtype => $frameworkcode, |
| 743 |
.'&duedatespec='.$fa_duedatespec |
746 |
borrowernumber => $loggedinuser, |
|
|
747 |
tab => scalar $input->param('tab'), |
| 748 |
NONXML_STRIPPED => $nonxml_stripped->{message}, |
| 744 |
); |
749 |
); |
|
|
750 |
output_html_with_http_headers $input, $cookie, $template->output; |
| 745 |
exit; |
751 |
exit; |
| 746 |
} |
752 |
} |
| 747 |
else { |
753 |
if ( |
| 748 |
print $input->redirect( |
754 |
!$encode_error |
|
|
755 |
&& ( $redirect eq "items" |
| 756 |
|| ( $mode ne "popup" && !$is_a_modif && $redirect ne "view" && $redirect ne "just_save" ) ) |
| 757 |
) |
| 758 |
{ |
| 759 |
if ( $frameworkcode eq 'FA' ) { |
| 760 |
print $input->redirect( '/cgi-bin/koha/cataloguing/additem.pl?' |
| 761 |
. 'biblionumber=' |
| 762 |
. $biblionumber |
| 763 |
. '&frameworkcode=' |
| 764 |
. $frameworkcode |
| 765 |
. '&circborrowernumber=' |
| 766 |
. $fa_circborrowernumber |
| 767 |
. '&branch=' |
| 768 |
. $fa_branch |
| 769 |
. '&barcode=' |
| 770 |
. uri_escape_utf8($fa_barcode) |
| 771 |
. '&stickyduedate=' |
| 772 |
. $fa_stickyduedate |
| 773 |
. '&duedatespec=' |
| 774 |
. $fa_duedatespec ); |
| 775 |
exit; |
| 776 |
} else { |
| 777 |
print $input->redirect( |
| 749 |
"/cgi-bin/koha/cataloguing/additem.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode&searchid=$searchid" |
778 |
"/cgi-bin/koha/cataloguing/additem.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode&searchid=$searchid" |
| 750 |
); |
779 |
); |
| 751 |
exit; |
780 |
exit; |
| 752 |
} |
781 |
} |
| 753 |
} elsif(!$encode_error && (($is_a_modif || $redirect eq "view") && $redirect ne "just_save")){ |
782 |
} elsif ( !$encode_error && ( ( $is_a_modif || $redirect eq "view" ) && $redirect ne "just_save" ) ) { |
| 754 |
my $defaultview = C4::Context->preference('IntranetBiblioDefaultView'); |
783 |
my $defaultview = C4::Context->preference('IntranetBiblioDefaultView'); |
| 755 |
my $views = { C4::Search::enabled_staff_search_views }; |
784 |
my $views = {C4::Search::enabled_staff_search_views}; |
| 756 |
if ($defaultview eq 'isbd' && $views->{can_view_ISBD}) { |
785 |
if ( $defaultview eq 'isbd' && $views->{can_view_ISBD} ) { |
| 757 |
print $input->redirect("/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=$biblionumber&searchid=$searchid"); |
786 |
print $input->redirect( |
| 758 |
} elsif ($defaultview eq 'marc' && $views->{can_view_MARC}) { |
787 |
"/cgi-bin/koha/catalogue/ISBDdetail.pl?biblionumber=$biblionumber&searchid=$searchid"); |
| 759 |
print $input->redirect("/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode&searchid=$searchid"); |
788 |
} elsif ( $defaultview eq 'marc' && $views->{can_view_MARC} ) { |
| 760 |
} elsif ($defaultview eq 'labeled_marc' && $views->{can_view_labeledMARC}) { |
789 |
print $input->redirect( |
| 761 |
print $input->redirect("/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=$biblionumber&searchid=$searchid"); |
790 |
"/cgi-bin/koha/catalogue/MARCdetail.pl?biblionumber=$biblionumber&frameworkcode=$frameworkcode&searchid=$searchid" |
|
|
791 |
); |
| 792 |
} elsif ( $defaultview eq 'labeled_marc' && $views->{can_view_labeledMARC} ) { |
| 793 |
print $input->redirect( |
| 794 |
"/cgi-bin/koha/catalogue/labeledMARCdetail.pl?biblionumber=$biblionumber&searchid=$searchid"); |
| 762 |
} else { |
795 |
} else { |
| 763 |
print $input->redirect("/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid"); |
796 |
print $input->redirect( |
|
|
797 |
"/cgi-bin/koha/catalogue/detail.pl?biblionumber=$biblionumber&searchid=$searchid"); |
| 764 |
} |
798 |
} |
| 765 |
exit; |
799 |
exit; |
| 766 |
} |
800 |
} elsif ( !$encode_error && ( $redirect eq "just_save" ) ) { |
| 767 |
elsif ( !$encode_error && ( $redirect eq "just_save" ) ) { |
|
|
| 768 |
my $tab = $input->param('current_tab'); |
801 |
my $tab = $input->param('current_tab'); |
| 769 |
print $input->redirect( |
802 |
print $input->redirect( |
| 770 |
"/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=$biblionumber&framework=$frameworkcode&tab=$tab&searchid=$searchid" |
803 |
"/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=$biblionumber&framework=$frameworkcode&tab=$tab&searchid=$searchid" |