19declare(strict_types=1);
36 public const string ID =
'bkbws';
45 array $visible_column_ids,
48 mixed $additional_viewcontrol_data,
50 mixed $additional_parameters
54 foreach ($records as $record) {
59 $date_from =
new DateTimeImmutable(
"@{$record['date_from']}");
61 ? $this->
lng->txt(
'book_all_day')
70 (
string) $record[
'booking_reservation_id'],
72 'title' => (
string) $record[
'title'],
74 ? $this->lng->txt(
'book_reservation_status_5')
78 'weekday' => $date_from,
79 'time_slot' => $time_slot,
81 'message' => (
string) ($record[
'message'] ??
''),
82 'user' => $this->getUserComponent(
$user_id)
93 'title' => $this->column_factory->text($this->
lng->txt(
'title')),
94 'status' => $this->column_factory->text($this->
lng->txt(
'status')),
95 'date' => $this->column_factory->date(
96 $this->
lng->txt(
'date'),
107 ->withIsOptional(
true,
true),
109 ->withIsOptional(
true,
true),
110 'time_slot' => $this->column_factory->text($this->
lng->txt(
'book_schedule_slot')),
111 'unit_count' => $this->column_factory->number($this->
lng->txt(
'book_no_of_objects')),
112 'message' => $this->column_factory->text($this->
lng->txt(
'book_message'))->withIsSortable(
false),
113 'user' => $this->column_factory->link($this->
lng->txt(
'user'))
116 if (!$this->booking_pool->usesMessages()) {
117 unset($columns[
'message']);
125 $txt_user = $this->
lng->txt(
'user');
127 $this->
access->canManageAllReservations($this->booking_pool->getRefId())
128 || $this->access->canReadPublicLog($this->booking_pool->getRefId())
130 $user_input = $this->input_factory->select($txt_user, $this->getUsers());
132 $user_input = $this->input_factory
133 ->select($txt_user, $this->getUsers($this->
user->getId()))
134 ->withValue($this->
user->getId())
135 ->withDisabled(
true);
139 'object' => $this->input_factory->select(
140 $this->
lng->txt(
'object'),
141 array_column($this->booking_items,
'title',
'booking_object_id')
143 'object_title_or_description' => $this->input_factory->text($this->
lng->txt(
'book_object_title_or_description')),
144 'period' => $this->input_factory->duration($this->
lng->txt(
'book_filter_period'))
146 ->withFormat($this->
user->getDateTimeFormat()),
147 'time_slot' => $this->input_factory->select($this->
lng->txt(
'book_schedule_slot'), $this->getTimeSlots()),
148 'past_bookings' => $this->input_factory->select(
149 $this->
lng->txt(
'book_show_past_bookings'),
150 [1 => $this->lng->txt(
'book_past_bookings'), 2 => $this->lng->txt(
'book_present_bookings')]
152 'status' => $this->input_factory->select($this->
lng->txt(
'status'), $this->getStatuses()),
153 'user' => $user_input
164 foreach ($this->bookings as $booking) {
165 $time_slot = $this->getBookingTimeSlotFilterLabel($booking);
166 $time_slots[$time_slot] ??= $time_slot;
174 return $this->isAllDayBooking($booking)
175 ? $this->
lng->txt(
'book_all_day')
176 : parent::getBookingTimeSlotFilterLabel($booking);
181 $object_id = (
int) $booking[
'object_id'];
182 $schedule_id = (
int) ($this->booking_items[$object_id][
'schedule_id'] ?? 0);
191 return $this->schedule_cache[$schedule_id] ??=
new ilBookingSchedule($schedule_id);
loadRecords(mixed $filter_data)
sortRecords(Order $order, array $records)
limitRecords(Range $range, array $records)
getSchedule(int $schedule_id)
getRows(DataRowBuilder $row_builder, array $visible_column_ids, Range $range, Order $order, mixed $additional_viewcontrol_data, mixed $filter_data, mixed $additional_parameters)
This is called by the table to retrieve rows; map data-records to rows using the $row_builder e....
getBookingTimeSlotFilterLabel(array $booking)
isAllDayBooking(array $booking)
Both the subject and the direction need to be specified when expressing an order.
A simple class to express a naive range of whole positive numbers.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const int STATUS_CANCELLED
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const SCHEDULE_TYPE_ALL_DAY
Class for date presentation.
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false, ?ilObjUser $user=null)
Format a period of two dates Shows: 14.
@classDescription Date and time handling
buildDataRow(string $id, array $record)