|
Lines 207-238
sub can_be_transferred {
Link Here
|
| 207 |
|
207 |
|
| 208 |
my $pickup_locations = $biblio->pickup_locations( {patron => $patron } ); |
208 |
my $pickup_locations = $biblio->pickup_locations( {patron => $patron } ); |
| 209 |
|
209 |
|
| 210 |
Returns an I<arrayref> of possible pickup locations for this biblio's items, |
210 |
Returns a Koha::Libraries set of possible pickup locations for this biblio's items, |
| 211 |
according to patron's home library (if patron is defined and holds are allowed |
211 |
according to patron's home library (if patron is defined and holds are allowed |
| 212 |
only from hold groups) and if item can be transferred to each pickup location. |
212 |
only from hold groups) and if item can be transferred to each pickup location. |
| 213 |
|
213 |
|
| 214 |
=cut |
214 |
=cut |
| 215 |
|
215 |
|
| 216 |
sub pickup_locations { |
216 |
sub pickup_locations { |
| 217 |
my ($self, $params) = @_; |
217 |
my ( $self, $params ) = @_; |
| 218 |
|
218 |
|
| 219 |
my $patron = $params->{patron}; |
219 |
my $patron = $params->{patron}; |
| 220 |
|
220 |
|
| 221 |
my @pickup_locations; |
221 |
my @pickup_locations; |
| 222 |
foreach my $item_of_bib ($self->items->as_list) { |
222 |
foreach my $item_of_bib ( $self->items->as_list ) { |
| 223 |
push @pickup_locations, @{ $item_of_bib->pickup_locations( {patron => $patron} )->as_list() }; |
223 |
push @pickup_locations, |
|
|
224 |
$item_of_bib->pickup_locations( { patron => $patron } ) |
| 225 |
->_resultset->get_column('branchcode')->all; |
| 224 |
} |
226 |
} |
| 225 |
|
227 |
|
| 226 |
my %seen; |
228 |
return Koha::Libraries->search( |
| 227 |
@pickup_locations = |
229 |
{ branchcode => { '-in' => \@pickup_locations } } ); |
| 228 |
grep { !$seen{ $_->branchcode }++ } @pickup_locations; |
|
|
| 229 |
|
| 230 |
return \@pickup_locations; |
| 231 |
} |
230 |
} |
| 232 |
|
231 |
|
| 233 |
=head3 hidden_in_opac |
232 |
=head3 hidden_in_opac |
| 234 |
|
233 |
|
| 235 |
my $bool = $biblio->hidden_in_opac({ [ rules => $rules ] }) |
234 |
my $bool = $biblio->hidden_in_opac({ [ rules => $rules ] }) |
| 236 |
|
235 |
|
| 237 |
Returns true if the biblio matches the hidding criteria defined in $rules. |
236 |
Returns true if the biblio matches the hidding criteria defined in $rules. |
| 238 |
Returns false otherwise. |
237 |
Returns false otherwise. |
| 239 |
- |
|
|