Lines 293-312
sub safe_to_delete {
Link Here
|
293 |
|
293 |
|
294 |
$error = "book_on_loan" if $self->checkout; |
294 |
$error = "book_on_loan" if $self->checkout; |
295 |
|
295 |
|
296 |
$error = "not_same_branch" |
296 |
$error //= "not_same_branch" |
297 |
if defined C4::Context->userenv |
297 |
if defined C4::Context->userenv |
298 |
and !C4::Context->IsSuperLibrarian() |
298 |
&& !C4::Context->IsSuperLibrarian() |
299 |
and C4::Context->preference("IndependentBranches") |
299 |
&& C4::Context->preference("IndependentBranches") |
300 |
and ( C4::Context->userenv->{branch} ne $self->homebranch ); |
300 |
&& ( C4::Context->userenv->{branch} ne $self->homebranch ); |
301 |
|
301 |
|
302 |
# check it doesn't have a waiting reserve |
302 |
# check it doesn't have a waiting reserve |
303 |
$error = "book_reserved" |
303 |
$error //= "book_reserved" |
304 |
if $self->holds->filter_by_found->count; |
304 |
if $self->holds->filter_by_found->count; |
305 |
|
305 |
|
306 |
$error = "linked_analytics" |
306 |
$error //= "linked_analytics" |
307 |
if C4::Items::GetAnalyticsCount( $self->itemnumber ) > 0; |
307 |
if C4::Items::GetAnalyticsCount( $self->itemnumber ) > 0; |
308 |
|
308 |
|
309 |
$error = "last_item_for_hold" |
309 |
$error //= "last_item_for_hold" |
310 |
if $self->biblio->items->count == 1 |
310 |
if $self->biblio->items->count == 1 |
311 |
&& $self->biblio->holds->search( |
311 |
&& $self->biblio->holds->search( |
312 |
{ |
312 |
{ |
313 |
- |
|
|