60 $this->tpl =
$DIC->ui()->mainTemplate();
62 $this->
ctrl = $DIC->ctrl();
64 $this->
lng = $DIC->language();
65 $this->
access = $DIC->bookingManager()->internal()->domain()->access();
66 $this->tabs_gui =
$DIC->tabs();
68 $this->
user = $DIC->user();
69 $this->book_request =
$DIC->bookingManager()->internal()->gui()->standardRequest();
70 $this->service =
$DIC->bookingManager()->internal();
71 $this->
ui = $DIC->ui();
72 $this->
toolbar = $DIC->toolbar();
73 $this->ui_service =
$DIC->uiservice();
75 $this->book_obj_id = $this->book_request->getObjectId();
79 $this->booked_user = $this->book_request->getBookedUser();
80 if ($this->booked_user === 0) {
81 $this->booked_user =
$DIC->user()->getId();
83 $this->reservation_id = $this->book_request->getReservationId();
85 $this->
ctrl->saveParameter($this, [
'object_id',
'bkusr']);
88 throw new ilException(
'Booking Object ID does not match Booking Pool.');
91 $this->raw_post_data =
$DIC->http()->request()->getParsedBody();
92 $this->util_gui =
$DIC
97 ->ProcessUtilGUI($this->pool, $this);
102 $reservation_ids = $this->book_request->getReservationIds();
103 if ($reservation_ids !== []) {
104 return $reservation_ids;
112 $cmd = $this->
ctrl->getCmd(self::DEFAULT_CMD);
119 'executeTableAction',
120 'changeStatusObject',
127 if (in_array($cmd, $cmds,
true)) {
134 $this->
help->setHelpId($a_id);
143 ? BookingsWithScheduleTable::class
144 : BookingsWithoutScheduleTable::class;
146 return new $booking_table_class(
147 $this->
ui->factory(),
148 $this->ui->renderer(),
155 $DIC->bookingManager()->internal()->repo()->reservation(),
158 $this->service->domain()->bookingSettings()->getByObjId($this->pool->getId()),
166 ILIAS_HTTP_PATH .
'/' . $this->
ctrl->getLinkTargetByClass(self::class,
'executeTableAction')
172 $object_id = $this->book_request->getObjectId();
173 if ($object_id <= 0) {
178 ? BookingsWithScheduleTable::ID .
'_filter'
179 : BookingsWithoutScheduleTable::ID .
'_filter';
182 $gateway->writeValue($filter_id,
'object', (
string) $object_id);
183 $gateway->writeActivated($filter_id,
true);
186 public function log(): void
191 $this->tpl->setContent(
192 $this->
ui->renderer()->render(
193 $bookings_table->getComponents($this->getTableActionUrlBuilder())
202 $this->
access->canManageAllReservations($this->ref_id) || $this->pool->hasPublicLog(),
203 $this->ui_service->filter()->getData($bookings_table->getFilter()) ?? [],
205 $this->context_obj_id !==
null ? [$this->context_obj_id] :
null
207 $reservations_table->getExportMode() > 0 && $reservations_table->exportData($reservations_table->getExportMode(),
true);
213 $this->
ctrl->redirectByClass(self::class,
'log');
218 $rsv_ids = $this->book_request->getReservationIds();
219 if ($rsv_ids === []) {
220 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
224 if ($this->
access->canManageAllReservations($this->ref_id)) {
228 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
232 protected function back(): void
234 $this->
ctrl->redirect($this,
'log');
240 !$this->
access->canManageAllReservations($this->ref_id)
246 if ($this->service->domain()->preferences($this->pool)->hasRun()) {
247 $this->
toolbar->addComponent($this->
ui->factory()->button()->standard(
248 $this->lng->txt(
'book_rerun_assignments'),
249 $this->ctrl->getLinkTarget($this,
'confirmResetRun')
256 if (!$this->
access->canManageAllReservations($this->ref_id)) {
260 $this->tabs_gui->activateTab(
'log');
261 $mess = $this->
ui->factory()->messageBox()->confirmation($this->
lng->txt(
'book_rerun_confirmation'))->withButtons(
263 $this->
ui->factory()->button()->standard($this->lng->txt(
'book_rerun_assignments'), $this->ctrl->getLinkTarget($this,
'resetRun')),
264 $this->ui->factory()->button()->standard($this->lng->txt(
'cancel'), $this->ctrl->getLinkTarget($this,
'log'))
267 $this->tpl->setContent($this->
ui->renderer()->render($mess));
272 if (!$this->
access->canManageAllReservations($this->ref_id)) {
278 && $this->access->canManageAllReservations($this->pool->getRefId())
280 $pref_manager = $this->service->domain()->preferences($this->pool);
281 $repo = $this->service->repo()->preferences();
282 $pref_manager->resetRun();
283 $pref_manager->storeBookings($repo->getPreferences($this->pool->getId()));
285 $this->
ctrl->redirect($this,
'log');
290 $this->
ctrl->saveParameter($this,
'object_id');
291 $this->util_gui->displayPostInfo($this->book_obj_id, 0,
'deliverPostFile');
296 $this->util_gui->deliverPostFile($this->book_obj_id, $this->
user->getId());
Provides fluid interface to RBAC services.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static lookupPoolId(int $object_id)
static changeStatus(array $a_ids, int $a_status)
Batch update reservation status.
getTableActionUrlBuilder()
ilGlobalTemplateInterface $tpl
StandardGUIRequest $book_request
presetBookingsFilterFromRequest()
ilBookingHelpAdapter $help
showRerunPreferenceAssignment()
__construct(ilObjBookingPool $pool, ilBookingHelpAdapter $help, ?int $context_obj_id=null)
Class ilCtrl provides processing control methods.
Base class for ILIAS Exception handling.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
const TYPE_NO_SCHEDULE_PREFERENCES
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...