|
Lines 160-165
use Koha::SearchFilters;
Link Here
|
| 160 |
|
160 |
|
| 161 |
use URI::Escape; |
161 |
use URI::Escape; |
| 162 |
use JSON qw( decode_json encode_json ); |
162 |
use JSON qw( decode_json encode_json ); |
|
|
163 |
use Koha::DateUtils qw( dt_from_string ); |
| 163 |
|
164 |
|
| 164 |
my $DisplayMultiPlaceHold = C4::Context->preference("DisplayMultiPlaceHold"); |
165 |
my $DisplayMultiPlaceHold = C4::Context->preference("DisplayMultiPlaceHold"); |
| 165 |
|
166 |
|
|
Lines 694-699
if ($hits) {
Link Here
|
| 694 |
$line->{has_local_cover_image} = |
695 |
$line->{has_local_cover_image} = |
| 695 |
$line->{biblio_object} ? $line->{biblio_object}->cover_images->count : 0; |
696 |
$line->{biblio_object} ? $line->{biblio_object}->cover_images->count : 0; |
| 696 |
} |
697 |
} |
|
|
698 |
|
| 699 |
if ( $line->{biblio_object} ) { |
| 700 |
my $bookable_items_count = $line->{biblio_object}->bookable_items->count; |
| 701 |
if ( $bookable_items_count > 0 ) { |
| 702 |
my $today = dt_from_string()->ymd; |
| 703 |
$line->{future_bookings_count} = $line->{biblio_object}->bookings->search({ |
| 704 |
start_date => { '>=' => $today }, |
| 705 |
status => { '-not_in' => ['cancelled', 'completed'] } |
| 706 |
})->count; |
| 707 |
$line->{has_bookable_items} = 1; |
| 708 |
} else { |
| 709 |
$line->{future_bookings_count} = 0; |
| 710 |
$line->{has_bookable_items} = 0; |
| 711 |
} |
| 712 |
} |
| 697 |
} |
713 |
} |
| 698 |
my ( |
714 |
my ( |
| 699 |
$page_numbers, $hits_to_paginate, $pages, $current_page_number, $previous_page_offset, $next_page_offset, |
715 |
$page_numbers, $hits_to_paginate, $pages, $current_page_number, $previous_page_offset, $next_page_offset, |