19declare(strict_types=1);
57 private readonly UIFactory $ui_factory,
65 private readonly array $bookings
86 return $this->
access->canManageAllReservations($this->booking_pool->getRefId());
95 $action_type = $this->
access->canManageAllReservations($this->booking_pool->getRefId()) ?
'standard' :
'single';
96 return $this->ui_factory->table()->action()->$action_type(
97 $this->
lng->txt($this->getActionLabel()),
100 ->withParameter($action_type_token, self::SHOW_MODAL_ACTION),
107 array $selected_records,
108 bool $all_records_selected
111 $this->
lng->txt(
'confirm'),
112 $this->
lng->txt(
'book_confirm_delete'),
113 $url_builder->buildURI()->__toString()
114 )->withAffectedItems(
117 (string) $selected_record[
'booking_reservation_id'],
118 $this->formatBookingDescription($selected_record)
122 )->withActionButtonLabel($this->
lng->txt($this->getActionLabel()));
127 if (!$this->
access->canManageAllReservations($this->booking_pool->getRefId())) {
133 foreach ($selected_records as $selected_record) {
135 $booking_reservation->delete();
138 $cal_entry_id = $booking_reservation->getCalendarEntry();
145 if ($selected_records !== []) {
155 fn(
int $selected_record): array => $this->bookings[$selected_record],
156 $selected_ids ?? array_keys($this->bookings)
171 return implode(
' – ',
$parts);
getModal(URLBuilder $url_builder, array $selected_records, bool $all_records_selected)
const string ACTION_LABEL
resolveRecords(?array $selected_ids=null)
formatBookingDescription(array $booking)
onSubmit(URLBuilder $url_builder, array $selected_records, bool $all_records_selected)
getTableAction(URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token)
__construct(private readonly AccessManager $access, private readonly UIFactory $ui_factory, private readonly UIRenderer $ui_renderer, private readonly Language $lng, private readonly ReservationDBRepository $reservation_repository, private readonly HttpService $http, private readonly ilGlobalTemplateInterface $tpl, private readonly ilCtrlInterface $ctrl, private readonly ilObjBookingPool $booking_pool, private readonly array $bookings)
allowActionForRecord(mixed $record)
Repo class for reservations Acts on tables booking_reservation (rw), booking_reservation_group (rw) a...
Builds a Color from either hex- or rgb values.
withParameter(URLBuilderToken $token, string|array $value)
Change an acquired parameter's value if the supplied token is valid.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Model for a calendar entry.
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
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getNamePresentation( $a_user_id, bool $a_user_image=false, bool $a_profile_link=false, string $a_profile_back_link='', bool $a_force_first_lastname=false, bool $a_omit_login=false, bool $a_sortable=true, bool $a_return_data_array=false, $a_ctrl_path=null)
Default behaviour is:
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Interface InterruptiveItem.
This describes commonalities between the different modals.
An entity that renders components to a string output.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
showErrorMessage(string $message)
readonly HttpService $http
readonly UIRenderer $ui_renderer
showSuccessMessage(string $message)
trait TableActionModalTrait
@template RecordType
modal(string $title="", string $cancel_label="")