19declare(strict_types=1);
42 private readonly UIFactory $ui_factory,
50 private readonly
bool $active_management,
67 $this->active_management
68 && ($this->
access->canManageOwnReservations($this->ref_id) || $this->
access->canManageObjects($this->ref_id));
77 return $this->ui_factory->table()->action()->single(
80 ->withParameter($action_token, self::
ACTION_ID)
81 ->withParameter($action_type_token,
'redirect'),
92 $row_id = (string) $this->
http->resolveRowParameter($row_id_token->getName());
93 $object_id = (
int) explode(
'_', $row_id)[0];
95 if ($object_id <= 0) {
99 $this->
ctrl->setParameterByClass(ilBookingReservationsGUI::class,
'object_id', (
int) $object_id);
101 if (!$this->
access->canManageAllReservations($this->ref_id) && !$this->
access->canReadPublicLog($this->ref_id)) {
102 $this->
ctrl->setParameterByClass(ilBookingReservationsGUI::class,
'user_id', (
int) $this->
user->getId());
106 $this->
ctrl->setParameterByClass(ilBookingReservationsGUI::class,
'period_from', explode(
'_', $row_id)[1] ??
null);
107 $this->
ctrl->setParameterByClass(ilBookingReservationsGUI::class,
'period_to', explode(
'_', $row_id)[2] ??
null);
110 $this->
ctrl->redirectByClass(ilBookingReservationsGUI::class,
'');
116 $has_reservations = $record[
'has_reservations'] ??
false;
119 $this->
access->canManageAllReservations($this->ref_id)
120 || $this->access->canReadPublicLog($this->ref_id)
122 return $has_reservations;
125 if ($this->
access->canManageOwnReservations($this->ref_id)) {
126 return $has_reservations && ($record[
'has_user_booking'] ??
false);
getTableAction(URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token)
allowActionForRecord(mixed $record)
const string ACTION_LABEL
__construct(private readonly UIFactory $ui_factory, private readonly ilLanguage $lng, private readonly ilCtrlInterface $ctrl, private readonly HttpService $http, private readonly AccessManager $access, private readonly ilObjUser $user, private readonly ilObjBookingPool $pool, private readonly int $ref_id, private readonly bool $active_management,)
onExecute(URLBuilder $url_builder, URLBuilderToken $row_id_token, URLBuilderToken $action_token, URLBuilderToken $action_type_token)
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...
return['delivery_method'=> 'php',]
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...
readonly HttpService $http
static http()
Fetches the global http state from ILIAS.