Lines 1834-1840
Return the relevant recall for this item
Link Here
|
1834 |
=cut |
1834 |
=cut |
1835 |
|
1835 |
|
1836 |
sub recall { |
1836 |
sub recall { |
1837 |
my ( $self ) = @_; |
1837 |
my ($self) = @_; |
1838 |
my @recalls = Koha::Recalls->search( |
1838 |
my @recalls = Koha::Recalls->search( |
1839 |
{ |
1839 |
{ |
1840 |
biblio_id => $self->biblionumber, |
1840 |
biblio_id => $self->biblionumber, |
Lines 1842-1852
sub recall {
Link Here
|
1842 |
}, |
1842 |
}, |
1843 |
{ order_by => { -asc => 'created_date' } } |
1843 |
{ order_by => { -asc => 'created_date' } } |
1844 |
)->as_list; |
1844 |
)->as_list; |
|
|
1845 |
|
1846 |
my $item_level_recall; |
1845 |
foreach my $recall (@recalls) { |
1847 |
foreach my $recall (@recalls) { |
1846 |
if ( $recall->item_level and $recall->item_id == $self->itemnumber ){ |
1848 |
if ( $recall->item_level ) { |
1847 |
return $recall; |
1849 |
$item_level_recall = 1; |
|
|
1850 |
if ( $recall->item_id == $self->itemnumber ) { |
1851 |
return $recall; |
1852 |
} |
1848 |
} |
1853 |
} |
1849 |
} |
1854 |
} |
|
|
1855 |
if ($item_level_recall) { |
1856 |
|
1857 |
# recall needs to be filled be a specific item only |
1858 |
# no other item is relevant to return |
1859 |
return; |
1860 |
} |
1861 |
|
1850 |
# no item-level recall to return, so return earliest biblio-level |
1862 |
# no item-level recall to return, so return earliest biblio-level |
1851 |
# FIXME: eventually this will be based on priority |
1863 |
# FIXME: eventually this will be based on priority |
1852 |
return $recalls[0]; |
1864 |
return $recalls[0]; |