Lines 770-775
sub marc_records_to_documents {
Link Here
|
770 |
$record_document->{'marc_format'} = 'base64ISO2709'; |
770 |
$record_document->{'marc_format'} = 'base64ISO2709'; |
771 |
} |
771 |
} |
772 |
} |
772 |
} |
|
|
773 |
|
774 |
# Check if there is at least one available item |
775 |
if ($self->index eq $BIBLIOS_INDEX) { |
776 |
my $biblio = Koha::Biblios->find($record->field('001')->data); |
777 |
my $items = $biblio->items; |
778 |
my $available = 0; |
779 |
while (my $item = $items->next) { |
780 |
next if $item->onloan; |
781 |
next if $item->notforloan; |
782 |
next if $item->withdrawn; |
783 |
next if $item->itemlost; |
784 |
next if $item->damaged; |
785 |
|
786 |
$available = 1; |
787 |
last; |
788 |
} |
789 |
|
790 |
$record_document->{available} = $available ? \1 : \0; |
791 |
} |
792 |
|
773 |
push @record_documents, $record_document; |
793 |
push @record_documents, $record_document; |
774 |
} |
794 |
} |
775 |
return \@record_documents; |
795 |
return \@record_documents; |