# get restricted status and description if applicable
if ( my $code = C4::Koha::GetAuthValCode( 'items.restricted', $data->{frameworkcode} ) ) {
- $data->{restricted} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{restricted} );
$data->{restrictedopac} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{restricted}, 1 );
+ $data->{restricted} = C4::Koha::GetKohaAuthorisedValueLib( $code, $data->{restricted} );
}
# my stack procedures
if ($onloan){
$error = "book_on_loan"
}
- elsif ( !(C4::Context->userenv->{flags} & 1) and
- C4::Context->preference("IndependantBranches") and
- (C4::Context->userenv->{branch} ne
- $item->{C4::Context->preference("HomeOrHoldingBranch")||'homebranch'}) )
+ elsif ( !( C4::Context->userenv->{flags} & 1 )
+ and C4::Context->preference("IndependantBranches")
+ and ( C4::Context->userenv->{branch} ne $item->{'homebranch'} ) )
{
$error = "not_same_branch";
}
my $query = "UPDATE items SET ";
my @bind;
for my $key ( keys %$item ) {
+ next if ( $key eq 'itemnumber' );
$query.="$key=?,";
push @bind, $item->{$key};
}
$authorised_lib{$branchcode} = $branchname;
}
}
- $defaultvalue = $defaultvalues->{branchcode} || C4::Context->userenv->{branch};
+
+ $defaultvalue = C4::Context->userenv->{branch};
+ if ( $defaultvalues and $defaultvalues->{branchcode} ) {
+ $defaultvalue = $defaultvalues->{branchcode};
+ }
#----- itemtypes
} elsif ( $tagslib->{$tag}->{$subfield}->{authorised_value} eq "itemtypes" ) {