Lines 742-753
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
742 |
} |
742 |
} |
743 |
); |
743 |
); |
744 |
|
744 |
|
|
|
745 |
my $block_mod = 0; |
745 |
if ($biblionumber){ |
746 |
if ($biblionumber){ |
746 |
my $does_bib_exist = Koha::Biblios->find($biblionumber); |
747 |
my $does_bib_exist = Koha::Biblios->find($biblionumber); |
747 |
if (!defined $does_bib_exist){ |
748 |
if (!defined $does_bib_exist){ |
748 |
$biblionumber = undef; |
749 |
$biblionumber = undef; |
749 |
$template->param( bib_doesnt_exist => 1 ); |
750 |
$template->param( bib_doesnt_exist => 1 ); |
750 |
} |
751 |
} |
|
|
752 |
else { |
753 |
if ( C4::Context->only_my_library() ) { |
754 |
my $items_rs = $does_bib_exist->items->search({ "homebranch" => { '!=' => C4::Context->userenv->{branch} } }); |
755 |
if ( $items_if->count ) { |
756 |
$block_mod = 1; |
757 |
} |
758 |
} |
759 |
} |
751 |
} |
760 |
} |
752 |
|
761 |
|
753 |
if ($frameworkcode eq 'FA'){ |
762 |
if ($frameworkcode eq 'FA'){ |
Lines 838-843
if ($biblionumber) {
Link Here
|
838 |
my $sth = $dbh->prepare("select biblioitemnumber from biblioitems where biblionumber=?"); |
847 |
my $sth = $dbh->prepare("select biblioitemnumber from biblioitems where biblionumber=?"); |
839 |
$sth->execute($biblionumber); |
848 |
$sth->execute($biblionumber); |
840 |
($biblioitemnumber) = $sth->fetchrow; |
849 |
($biblioitemnumber) = $sth->fetchrow; |
|
|
850 |
|
851 |
# notify the template if we are blocking modifs |
852 |
$template->param( block_mod => $block_mod ); |
841 |
} |
853 |
} |
842 |
|
854 |
|
843 |
#------------------------------------------------------------------------------------- |
855 |
#------------------------------------------------------------------------------------- |
Lines 859-865
if ( $op eq "addbiblio" ) {
Link Here
|
859 |
if ( !$duplicatebiblionumber or $confirm_not_duplicate ) { |
871 |
if ( !$duplicatebiblionumber or $confirm_not_duplicate ) { |
860 |
my $oldbibitemnum; |
872 |
my $oldbibitemnum; |
861 |
if ( $is_a_modif ) { |
873 |
if ( $is_a_modif ) { |
862 |
ModBiblio( $record, $biblionumber, $frameworkcode ); |
874 |
ModBiblio( $record, $biblionumber, $frameworkcode ) unless ($block_mod); |
863 |
} |
875 |
} |
864 |
else { |
876 |
else { |
865 |
( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode ); |
877 |
( $biblionumber, $oldbibitemnum ) = AddBiblio( $record, $frameworkcode ); |