19declare(strict_types=1);
47 private readonly UIFactory $ui_factory,
55 private readonly
bool $active_management,
71 return $this->active_management && $this->
access->canManageObjects($this->ref_id);
83 ->withParameter($action_token, self::
ACTION_ID)
84 ->withParameter($action_type_token, self::SHOW_MODAL_ACTION),
96 array $selected_records,
97 bool $all_records_selected
100 $this->
lng->txt(
'confirm'),
101 $this->
lng->txt(
'book_confirm_delete'),
102 $url_builder->buildURI()->__toString()
103 )->withAffectedItems(
106 (string) $record[
'booking_object_id'],
107 (string) $record[
'title']
111 )->withActionButtonLabel($this->
lng->txt(
'delete'));
116 array $selected_records,
117 bool $all_records_selected
119 if (!$this->
access->canManageObjects($this->ref_id)) {
124 foreach ($selected_records as $record) {
125 $object_id = (
int) ($record[
'booking_object_id'] ?? 0);
126 if ($object_id <= 0) {
131 $object->deleteReservationsAndCalEntries($object_id);
147 $by_id[(
int) $item[
'booking_object_id']] = [
148 'booking_object_id' => (
int) $item[
'booking_object_id'],
149 'title' => (string) $item[
'title'],
153 if ($selected_ids ===
null) {
154 return array_values($by_id);
157 $unique = array_values(array_unique(array_map(
'intval', $selected_ids)));
159 foreach ($unique as $object_id) {
160 if (!isset($by_id[$object_id])) {
164 $result[] = $by_id[$object_id];
resolveRecords(?array $selected_ids=null)
getTableAction(URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token)
const string ACTION_LABEL
__construct(private readonly UIFactory $ui_factory, private readonly UIRenderer $ui_renderer, private readonly ilLanguage $lng, private readonly ilGlobalTemplateInterface $tpl, private readonly HttpService $http, private readonly AccessManager $access, private readonly ilObjBookingPool $pool, private readonly int $ref_id, private readonly bool $active_management,)
allowActionForRecord(mixed $record)
onSubmit(URLBuilder $url_builder, array $selected_records, bool $all_records_selected)
getModal(URLBuilder $url_builder, array $selected_records, bool $all_records_selected)
Builds a Color from either hex- or rgb values.
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...
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.
showErrorMessage(string $message)
readonly HttpService $http
readonly UIRenderer $ui_renderer
showSuccessMessage(string $message)
trait TableActionModalTrait
@template RecordType
modal(string $title="", string $cancel_label="")
if(!file_exists('../ilias.ini.php'))