25     protected \ILIAS\BookingManager\BookingProcess\ProcessUtilGUI 
$util_gui;
    26     protected \ILIAS\BookingManager\Access\AccessManager 
$access;
    28     protected \ILIAS\DI\UIServices 
$ui;
    29     protected \ILIAS\BookingManager\InternalService 
$service;
    49         int $context_obj_id = 0
    53         $this->tpl = $DIC->ui()->mainTemplate();
    55         $this->
ctrl = $DIC->ctrl();
    57         $this->
lng = $DIC->language();
    58         $this->
access = $DIC->bookingManager()->internal()->domain()->access();
    59         $this->tabs_gui = $DIC->tabs();
    61         $this->
user = $DIC->user();
    62         $this->book_request = $DIC->bookingManager()
    66         $this->service = $DIC->bookingManager()->internal();
    67         $this->
ui = $DIC->ui();
    68         $this->
toolbar = $DIC->toolbar();
    70         $this->book_obj_id = $this->book_request->getObjectId();
    75         $this->booked_user = $this->book_request->getBookedUser();
    76         if ($this->booked_user === 0) {
    77             $this->booked_user = $DIC->user()->getId();
    80         $this->reservation_id = $this->book_request->getReservationId();
    82         $this->
ctrl->saveParameter($this, [
"object_id", 
"bkusr"]);
    85             throw new ilException(
"Booking Object ID does not match Booking Pool.");
    88         $this->raw_post_data = $DIC->http()->request()->getParsedBody();
    89         $this->util_gui = $DIC->bookingManager()->internal()->gui()->process()->ProcessUtilGUI(
   100         $mrsv = $this->book_request->getReservationIds();
   101         if (count($mrsv) > 0) {
   104         if ($this->reservation_id > 0) {
   105             return array($this->reservation_id);
   115         $cmd = $ctrl->
getCmd(
"log");
   117         switch ($next_class) {
   119                 if (in_array($cmd, array(
"log", 
"logDetails", 
"changeStatusObject", 
"rsvConfirmCancelUser", 
"rsvCancelUser",
   120                     "applyLogFilter", 
"resetLogFilter", 
"rsvConfirmCancel", 
"rsvCancel", 
"back", 
"rsvConfirmDelete", 
"rsvDelete", 
"confirmResetRun", 
"resetRun", 
"displayPostInfo", 
"deliverPostFile", 
"redirectMailToBooker"))) {
   128         $this->
help->setHelpId($a_id);
   134     public function log(): void
   146         ?
string $reservation_id = null
   148         $show_all = ($this->
access->canManageAllReservations($this->ref_id) || $this->pool->hasPublicLog());
   151         if ($this->book_obj_id > 0) {
   155         if ($this->book_request->getUserId() > 0) {
   156             $filter[
"user_id"] = $this->book_request->getUserId();
   158         $context_filter = ($this->context_obj_id > 0)
   159             ? [$this->context_obj_id]
   178         $this->tabs_gui->clearTargets();
   179         $this->tabs_gui->setBackTarget(
   180             $this->
lng->txt(
"back"),
   181             $this->
ctrl->getLinkTarget($this, 
"log")
   193         $rsv_ids = $this->book_request->getReservationIds();
   194         if (count($rsv_ids) === 0) {
   195             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
   199         if ($this->
access->canManageAllReservations($this->ref_id)) {
   202                 $this->book_request->getStatus()
   206         $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'), 
true);
   207         $this->
ctrl->redirect($this, 
'log');
   213         $table->resetOffset();
   214         $table->writeFilterToSession();
   221         $table->resetOffset();
   222         $table->resetFilter();
   252         $conf->setFormAction($ilCtrl->getFormAction($this));
   253         $conf->setHeaderText($lng->
txt(
'book_confirm_cancel'));
   256         $conf->addItem(
'object_id', 
$id, $type->getTitle());
   257         $conf->setConfirm($lng->
txt(
'book_set_cancel'), 
'rsvCancelUser');
   258         $conf->setCancel($lng->
txt(
'cancel'), 
'back');
   280         if ($obj->getUserId() !== 
$user_id) {
   281             $this->tpl->setOnScreenMessage(
'failure', $lng->
txt(
'permission_denied'), 
true);
   288         $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
'settings_saved'), 
true);
   295     protected function back(): void
   297         $this->
ctrl->redirect($this, 
"log");
   311         if (count($ids) === 0) {
   315         foreach ($ids as $idx => 
$id) {
   316             if (!is_numeric(
$id)) {
   317                 [$obj_id, 
$user_id, $from, $to] = explode(
"_", 
$id);
   319                 $valid_ids = array();
   321                     $valid_ids[$item[
"booking_object_id"]] = $item[
"title"];
   323                 if (array_key_exists($obj_id, $valid_ids) && $from > time() && ($this->
access->canManageAllReservations($this->ref_id) || (
int) $user_id === $ilUser->getId())) {
   325                     if (!count($rsv_ids)) {
   328                     if (count($rsv_ids) > 1) {
   329                         $max[
$id] = count($rsv_ids);
   330                         $ids[$idx] = $rsv_ids;
   333                         $ids[$idx] = array_shift($rsv_ids);
   341         if (!is_array($ids) || !count($ids)) {
   342             $this->
ctrl->redirect($this, 
'log');
   346         if (count($max) && max($max) > 1) {
   351         $this->tabs_gui->clearTargets();
   352         $this->tabs_gui->setBackTarget(
   354             $ilCtrl->getLinkTargetByClass(
"ilBookingReservationsGUI", 
"")
   360         $conf->setFormAction($ilCtrl->getFormAction($this, 
'rsvCancel'));
   361         $conf->setHeaderText($lng->
txt(
'book_confirm_cancel'));
   362         $conf->setConfirm($lng->
txt(
'book_set_cancel'), 
'rsvCancel');
   363         $conf->setCancel($lng->
txt(
'cancel'), 
'back');
   365         foreach ($ids as 
$id) {
   377             $conf->addItem(
'rsv_id[]', $id, $details);
   394         $this->tabs_gui->clearTargets();
   395         $this->tabs_gui->setBackTarget(
   397             $ilCtrl->getLinkTarget($this, 
"log")
   403         $this->tpl->setOnScreenMessage(
'question', $lng->
txt(
"book_confirm_cancel"));
   417         $form->setFormAction($this->
ctrl->getFormAction($this, 
"rsvCancel"));
   418         $form->setTitle($this->
lng->txt(
"book_confirm_cancel_aggregation"));
   422         foreach ($a_ids as $idx => $ids) {
   424             if (is_array($ids)) {
   425                 $first = array_shift($first);
   437             if (is_array($ids)) {
   438                 $caption .= 
" (" . count($ids) . 
")";
   442             $item->setRequired(
true);
   443             $item->setMinValue(0);
   445             $form->addItem($item);
   447             if (is_array($ids)) {
   448                 $item->setMaxValue(count($ids));
   450                 foreach ($ids as 
$id) {
   452                     $hidden->setValue($id);
   453                     $form->addItem($hidden);
   456                 $item->setMaxValue(1);
   459                 $hidden->setValue($ids);
   460                 $form->addItem($hidden);
   463             if ($this->book_request->getCancelNr($idx)) {
   464                 $item->setValue($this->book_request->getCancelNr($idx));
   468         $form->addCommandButton(
"rsvCancel", $this->
lng->txt(
"confirm"));
   469         $form->addCommandButton(
"log", $this->
lng->txt(
"cancel"));
   485         $ids = $this->book_request->getReservationIds();
   487         $rsv_aggr = $this->raw_post_data[
"rsv_aggr"] ?? null;
   489         if (!is_null($rsv_aggr)) {
   491             if (!$form->checkInput()) {
   492                 $this->tabs_gui->clearTargets();
   493                 $this->tabs_gui->setBackTarget(
   495                     $ilCtrl->getLinkTarget($this, 
"log")
   503             foreach ($rsv_aggr as $idx => $aggr_ids) {
   504                 $max = $this->book_request->getCancelNr($idx);
   506                     if (!is_array($aggr_ids)) {
   509                         $aggr_ids = array_slice($aggr_ids, 0, $max);
   510                         $ids = array_merge($ids, $aggr_ids);
   518             foreach ($ids as 
$id) {
   522                 if (!$this->
access->canManageReservationForUser($this->ref_id, 
$res->getUserId())) {
   523                     $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'), 
true);
   524                     $this->
ctrl->redirect($this, 
'log');
   532                     $cal_entry_id = 
$res->getCalendarEntry();
   541         $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'));
   548         if (!$this->
access->canManageAllReservations($this->ref_id)) {
   549             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'), 
true);
   550             $this->
ctrl->redirect($this, 
'log');
   554         if (count($ids) === 0) {
   558         $this->tabs_gui->clearTargets();
   559         $this->tabs_gui->setBackTarget(
   560             $this->
lng->txt(
"back"),
   561             $this->
ctrl->getLinkTarget($this, 
"log")
   565         $conf->setFormAction($this->
ctrl->getFormAction($this, 
'rsvDelete'));
   566         $conf->setHeaderText($this->
lng->txt(
'book_confirm_delete'));
   567         $conf->setConfirm($this->
lng->txt(
'book_set_delete'), 
'rsvDelete');
   568         $conf->setCancel($this->
lng->txt(
'cancel'), 
'log');
   571             foreach ($ids as $idx => 
$id) {
   572                 [$obj_id, 
$user_id, $from, $to] = explode(
"_", 
$id);
   574                 $rsv_id = $rsv_ids[0];
   579                 $details = sprintf($this->
lng->txt(
'X_reservations_of'), count($rsv_ids)) . 
' ' . $obj->
getTitle();
   584                 $conf->addItem(
'mrsv[]', 
$id, $details);
   587             foreach ($ids as $idx => $rsv_id) {
   590                 $details = sprintf($this->
lng->txt(
'X_reservations_of'), 1) . 
' ' . $obj->
getTitle();
   591                 $conf->addItem(
'mrsv[]', $rsv_id, $details);
   594         $this->tpl->setContent($conf->getHTML());
   600         $get = $DIC->http()->request()->getParsedBody()[
'mrsv'];
   602             foreach ($get as 
$id) {
   604                     list($obj_id, 
$user_id, $from, $to) = explode(
"_", $id);
   610                 foreach ($rsv_ids as $rsv_id) {
   613                     if (!$this->
access->canManageAllReservations($this->ref_id) || $obj->getPoolId() !== $this->pool->getId()) {
   614                         $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'), 
true);
   615                         $this->
ctrl->redirect($this, 
'log');
   618                         $cal_entry_id = 
$res->getCalendarEntry();
   628         $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'reservation_deleted'), 
true);
   629         $this->
ctrl->redirect($this, 
'log');
   634         if (!$this->
access->canManageAllReservations($this->ref_id)) {
   638             $pref_manager = $this->service->domain()->preferences($this->pool);
   639             if ($pref_manager->hasRun()) {
   640                 $this->
toolbar->addComponent($this->
ui->factory()->button()->standard(
   641                     $this->
lng->txt(
"book_rerun_assignments"),
   642                     $this->
ctrl->getLinkTarget($this, 
"confirmResetRun")
   650         if (!$this->
access->canManageAllReservations($this->ref_id)) {
   653         $this->tabs_gui->activateTab(
"log");
   654         $mess = $this->
ui->factory()->messageBox()->confirmation($this->
lng->txt(
"book_rerun_confirmation"))->withButtons(
   656                 $this->
ui->factory()->button()->standard(
   657                     $this->
lng->txt(
"book_rerun_assignments"),
   658                     $this->
ctrl->getLinkTarget($this, 
"resetRun")
   660                 $this->
ui->factory()->button()->standard(
   661                     $this->
lng->txt(
"cancel"),
   662                     $this->
ctrl->getLinkTarget($this, 
"log")
   666         $this->tpl->setContent(
   667             $this->
ui->renderer()->render($mess)
   673         if (!$this->
access->canManageAllReservations($this->ref_id)) {
   677             && $this->
access->canManageAllReservations($this->pool->getRefId())) {
   678             $pref_manager = $this->service->domain()->preferences($this->pool);
   679             $repo = $this->service->repo()->preferences();
   680             $pref_manager->resetRun();
   681             $pref_manager->storeBookings(
   682                 $repo->getPreferences($this->pool->getId())
   685         $this->
ctrl->redirect($this, 
"log");
   690         $this->
ctrl->saveParameter($this, 
"object_id");
   691         $this->util_gui->displayPostInfo(
   700         $this->util_gui->deliverPostFile(
   708         if (!$this->
access->canManageAllReservations($this->ref_id)) {
   709             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'), 
true);
   710             $this->
ctrl->redirect($this, 
'log');
   714         if (count($ids) === 0) {
   720             foreach ($ids as $idx => 
$id) {
   721                 [$obj_id, 
$user_id, $from, $to] = explode(
"_", 
$id);
   723                 $rsv_id = $rsv_ids[0];
   728             foreach ($ids as $idx => $rsv_id) {
   733         $logins = implode(
",", $users);
   735         $sig = chr(13) . chr(10) . chr(13) . chr(10) . chr(13) . chr(10);
   736         $sig .= $this->
lng->txt(
'book_mail_permanent_link') . 
": ";
   737         $sig .= chr(13) . chr(10);
   738         $sig .= ilLink::_getLink($this->book_request->getRefId());
   739         $sig = rawurlencode(base64_encode($sig));
 
static array static setUseRelativeDates(bool $a_status)
set use relative dates 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static changeStatus(array $a_ids, int $a_status)
Batch update reservation status. 
 
rsvCancelUser()
(C1.a) Confirmed (C1) 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
 
ILIAS BookingManager Access AccessManager $access
 
getCmd(string $fallback_command=null)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
ILIAS BookingManager InternalService $service
 
static getObjectReservationForUser(int $a_object_id, int $a_user_id)
 
back()
Back to reservation list. 
 
rsvConfirmCancel()
(C2) Confirmation screen for canceling booking from reservations screen (with and without schedule) ...
 
ilBookingHelpAdapter $help
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
getReservationsTable(?string $reservation_id=null)
Get reservationsTable. 
 
getLogReservationIds()
Reservations IDs as currently provided from. 
 
showRerunPreferenceAssignment()
 
getNextClass($a_gui_class=null)
 
setContent(string $a_html)
Sets content for standard template. 
 
ilGlobalTemplateInterface $tpl
 
rsvConfirmCancelUser()
(C1) Confirmation screen for canceling booking without schedule from booking objects screen or from p...
 
static getCancelDetails(int $a_obj_id, int $a_user_id, int $a_from, int $a_to)
Get reservation ids from aggregated id for cancellation. 
 
__construct(ilObjBookingPool $pool, ilBookingHelpAdapter $help, int $context_obj_id=0)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static redirect(string $a_script)
 
ILIAS BookingManager BookingProcess ProcessUtilGUI $util_gui
 
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false, ilObjUser $user=null)
Format a period of two dates Shows: 14. 
 
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins 
 
changeStatusObject()
Change status of given reservations. 
 
ILIAS BookingManager StandardGUIRequest $book_request
 
rsvConfirmCancelAggregationForm(array $a_ids)
Form being used in (C2.a) 
 
static lookupPoolId(int $object_id)
 
const TYPE_NO_SCHEDULE_PREFERENCES
 
static getList(int $a_pool_id, string $a_title=null)
Get list of booking objects. 
 
rsvCancel()
(C2.b) Cancel reservations (coming from C2 or C2.a) 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
rsvConfirmCancelAggregation(array $a_ids=null)
(C2.a) Cancel aggregated booking from reservations screen (with and without schedule) called in (C2) ...
 
static _lookupLogin(int $a_user_id)