19declare(strict_types=1);
29 public const string ID =
'bkbiwos';
36 $column_factory = $this->ui_factory->table()->column();
38 'availability' => $column_factory->text($this->
lng->txt(
'book_table_col_availability'))->withIsSortable(
true),
39 'title' => $column_factory->text($this->
lng->txt(
'title'))->withIsSortable(
true),
40 'description' => $column_factory->text($this->
lng->txt(
'description'))->withIsSortable(
true),
51 $bookable_items[(
int) $item[
'booking_object_id']] = (
string) $item[
'title'];
54 $field_factory = $this->ui_factory->input()->field();
56 'title' => $field_factory->text($this->
lng->txt(
'title')),
57 'description' => $field_factory->text($this->lng->txt(
'description')),
58 'objects' => $field_factory->multiSelect($this->lng->txt(
'book_filter_objects'), $bookable_items),
67 $filter_data = is_array($filter_data) ? $filter_data : [];
69 $title_filter = trim((
string) ($filter_data[
'title'] ??
'')) ?:
null;
70 $description_filter = trim((
string) ($filter_data[
'description'] ??
'')) ?:
null;
71 $object_ids_filter = ($filter_data[
'objects'] ?? []) !== []
72 ? array_map(
'intval', $filter_data[
'objects'])
77 $object_id = (
int) $item[
'booking_object_id'];
79 $user_has_booking =
false;
80 $user_has_active_booking =
false;
88 $user_has_booking =
true;
94 $user_has_active_booking =
true;
99 'row_id' => (string) $object_id,
100 'booking_object_id' => $object_id,
101 'title' => (
string) $item[
'title'],
102 'description' => (string) ($item[
'description'] ??
''),
103 'nr_items' => (
int) $item[
'nr_items'],
104 'available' => $available,
105 'is_available' => $available > 0,
106 'has_user_booking' => $user_has_booking,
107 'has_user_active_booking' => $user_has_active_booking,
109 'post_text' => (string) ($item[
'post_text'] ??
''),
122 'availability' => $this->
buildAvailabilityCell((
int) $record[
'available'], (
int) $record[
'nr_items']),
123 'title' => (string) $record[
'title'],
124 'description' => nl2br((
string) $record[
'description']),
loadFilteredBookingObjects(?string $title_filter, ?string $description_filter, ?array $object_ids_filter)
buildAvailabilityCell(int $available, int $total)
getReservationsForObject(int $booking_object_id)
buildRowCells(array $record)
loadRecords(mixed $filter_data)
hasActiveReservations(int $object_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getList(int $a_pool_id, ?string $a_title=null)
Get list of booking objects.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const int STATUS_CANCELLED
static numAvailableFromObjectNoSchedule(int $a_obj_id)
A Column describes the form of presentation for a certain aspect of data, i.e.