Booking process ui class.
More...
◆ __construct()
| ilBookingProcessWithScheduleGUI::__construct |
( |
ilObjBookingPool |
$pool, |
|
|
int |
$booking_object_id, |
|
|
string |
$seed = "", |
|
|
int |
$context_obj_id = 0 |
|
) |
| |
Definition at line 54 of file class.ilBookingProcessWithScheduleGUI.php.
References $booking_object_id, $context_obj_id, $DIC, $pool, $seed, $user_id_assigner, ILIAS\Repository\access(), ILIAS\Repository\ctrl(), ilObject\getId(), ILIAS\Repository\help(), ILIAS\FileDelivery\http(), ILIAS\Repository\lng(), and ILIAS\Repository\user().
62 $this->
ctrl = $DIC->ctrl();
63 $this->tpl = $DIC[
"tpl"];
64 $this->
lng = $DIC->language();
65 $this->
access = $DIC->access();
66 $this->tabs_gui = $DIC->tabs();
67 $this->
user = $DIC->user();
68 $this->
http = $DIC->http();
77 $internal_service = $DIC->bookingManager()->internal();
78 $this->gui = $internal_service->gui();
79 $domain = $internal_service->domain();
80 $this->book_request = $this->gui->standardRequest();
81 $this->
help = $this->gui->bookingHelp($pool);
82 $this->log = $domain->log();
84 $this->repo = $internal_service->repo();
86 $this->object_manager = $domain->objects($pool->
getId());
87 $this->object_selection = $domain->objectSelection($pool->
getId());
89 $this->rsv_ids = $this->book_request->getReservationIdsFromString();
91 $this->raw_post_data = $DIC->http()->request()->getParsedBody();
93 $this->user_id_assigner = $this->
user->getId();
94 if ($this->book_request->getBookedUser() > 0) {
95 $this->user_id_to_book = $this->book_request->getBookedUser();
99 $this->
ctrl->saveParameter($this, [
"bkusr",
"returnCmd"]);
100 $this->
ctrl->setParameter($this,
"seed", $this->seed);
102 $this->process = $DIC->bookingManager()->internal()->domain()->process();
103 $this->reservation = $DIC->bookingManager()->internal()->domain()->reservations();
104 $this->util_gui = $DIC->bookingManager()->internal()->gui()->process()->ProcessUtilGUI(
static http()
Fetches the global http state from ILIAS.
◆ assignParticipants()
| ilBookingProcessWithScheduleGUI::assignParticipants |
( |
| ) |
|
◆ back()
| ilBookingProcessWithScheduleGUI::back |
( |
| ) |
|
◆ book()
| ilBookingProcessWithScheduleGUI::book |
( |
| ) |
|
Triggered from object list week view for booking a single object / confirmation for.
Implements ILIAS\BookingManager\BookingProcess\BookingProcessGUI.
Definition at line 205 of file class.ilBookingProcessWithScheduleGUI.php.
References $seed, $tpl, ilCalendarUserSettings\_getInstanceByUserId(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\setContent(), and ILIAS\Repository\user().
207 $this->log->debug(
"Step 1, book");
210 $this->tabs_gui->clearTargets();
211 $this->tabs_gui->setBackTarget($this->
lng->txt(
'book_back_to_list'), $this->
ctrl->getLinkTarget($this,
'back'));
213 $this->util_gui->setHelpId(
"book");
217 $this->
lng->loadLanguageModule(
"dateplaner");
218 $this->
ctrl->setParameter($this,
'object_id', $obj->getId());
221 if ($this->user_id_to_book !== $this->user_id_assigner) {
222 $this->
ctrl->setParameter($this,
'bkusr', $this->user_id_to_book);
227 $week_gui = new \ILIAS\BookingManager\BookingProcess\WeekGUI(
231 $this->pool->getId(),
233 $user_settings->getWeekStart()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getInstanceByUserId(int $a_user_id)
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
◆ bookAvailableItems()
| ilBookingProcessWithScheduleGUI::bookAvailableItems |
( |
?int |
$recurrence = null, |
|
|
?ilDateTime |
$until = null |
|
) |
| |
|
protected |
Definition at line 467 of file class.ilBookingProcessWithScheduleGUI.php.
References $message, IL_CAL_UNIX, ILIAS\Repository\int(), and ILIAS\Repository\lng().
469 $this->log->debug(
"bookAvailableItems");
470 $obj_id = $this->book_request->getObjectId();
471 $from = $this->book_request->getSlotFrom();
472 $to = $this->book_request->getSlotTo();
473 $nr = $this->book_request->getNr();
474 $message = $this->pool->usesMessages()
475 ? $this->book_request->getMessage()
477 if (is_null($recurrence)) {
478 $recurrence = (
int) $this->book_request->getRecurrence();
480 if (is_null($until)) {
481 if ($this->book_request->getUntil() > 0) {
486 $booked = $this->process->bookAvailableObjects(
488 $this->user_id_to_book,
489 $this->user_id_assigner,
490 $this->context_obj_id,
498 if (count($booked) > 0) {
499 $this->util_gui->handleBookingSuccess($obj_id,
"displayPostInfo", $booked);
501 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'book_reservation_failed'),
true);
502 $this->util_gui->back();
◆ checkAvailability()
| ilBookingProcessWithScheduleGUI::checkAvailability |
( |
bool |
$incl_recurrence = true, |
|
|
int |
$nr = 0, |
|
|
string |
$message = "" |
|
) |
| |
Definition at line 377 of file class.ilBookingProcessWithScheduleGUI.php.
References $message, ILIAS\Repository\ctrl(), getBookAvailableTarget(), getBookgingObjectTitle(), getMissingAvailabilityMessage(), getRecurrenceForm(), IL_CAL_UNIX, ILIAS\Repository\int(), ILIAS\Repository\lng(), and send().
Referenced by processNumberForm().
382 $this->log->debug(
"checkAvailability");
383 $obj_id = $this->book_request->getObjectId();
384 $from = $this->book_request->getSlotFrom();
385 $to = $this->book_request->getSlotTo();
387 $nr = $this->book_request->getNr();
389 if (
$message ===
"" && $this->pool->usesMessages()) {
390 $message = $this->book_request->getMessage();
394 if ($incl_recurrence) {
397 if (!$form->isValid()) {
403 $recurrence = (
int) $form->getData(
"recurrence");
404 $until = $form->getData(
"until" . $recurrence);
408 $this->
ctrl->saveParameter($this, [
"object_id",
"slot",
"nr"]);
409 if ($this->pool->usesMessages()) {
410 $this->
ctrl->setParameter(
416 $this->
ctrl->setParameter($this,
"recurrence", $recurrence);
417 $this->
ctrl->setParameter($this,
"until", $until_ts);
420 $this->book_request->getSlot(),
426 if ($incl_recurrence) {
428 $missing = $this->process->getRecurrenceMissingAvailability(
438 if (count($missing) > 0) {
443 $this->
lng->txt(
"book_book_available"),
444 $book_available_target,
450 $this->gui->send(
"<script>window.location.href = '" . $book_available_target .
"';</script>");
getBookAvailableTarget(int $obj_id, string $slot, int $recurrence, int $nr, int $until)
getMissingAvailabilityMessage(array $missing)
catch(ilCmiXapiException $e) send($response)
◆ deliverPostFile()
| ilBookingProcessWithScheduleGUI::deliverPostFile |
( |
| ) |
|
◆ displayPostInfo()
| ilBookingProcessWithScheduleGUI::displayPostInfo |
( |
| ) |
|
◆ executeCommand()
| ilBookingProcessWithScheduleGUI::executeCommand |
( |
| ) |
|
Definition at line 110 of file class.ilBookingProcessWithScheduleGUI.php.
References $ctrl, ilCtrl\getCmd(), and ilCtrl\getNextClass().
116 switch ($next_class) {
118 if (in_array($cmd, array(
"book",
"back",
"week",
119 "assignParticipants",
120 "bookMultipleParticipants",
121 "saveMultipleBookings",
126 "bookAvailableItems",
129 "redirectToParticipantsList" getCmd(string $fallback_command=null)
getNextClass($a_gui_class=null)
◆ getBookAvailableTarget()
| ilBookingProcessWithScheduleGUI::getBookAvailableTarget |
( |
int |
$obj_id, |
|
|
string |
$slot, |
|
|
int |
$recurrence, |
|
|
int |
$nr, |
|
|
int |
$until |
|
) |
| |
|
protected |
Definition at line 506 of file class.ilBookingProcessWithScheduleGUI.php.
References ILIAS\Repository\ctrl().
Referenced by checkAvailability().
513 $this->
ctrl->setParameter($this,
"obj_id", $obj_id);
514 $this->
ctrl->setParameter($this,
"slot", $slot);
515 $this->
ctrl->setParameter($this,
"recurrence", $recurrence);
516 $this->
ctrl->setParameter($this,
"nr", $nr);
517 $this->
ctrl->setParameter($this,
"until", $until);
518 return $this->
ctrl->getLinkTarget($this,
"bookAvailableItems");
◆ getBookgingObjectTitle()
| ilBookingProcessWithScheduleGUI::getBookgingObjectTitle |
( |
| ) |
|
|
protected |
◆ getMissingAvailabilityMessage()
| ilBookingProcessWithScheduleGUI::getMissingAvailabilityMessage |
( |
array |
$missing | ) |
|
|
protected |
◆ getNumberForm()
| ilBookingProcessWithScheduleGUI::getNumberForm |
( |
int |
$from, |
|
|
int |
$to |
|
) |
| |
|
protected |
- Exceptions
-
Definition at line 271 of file class.ilBookingProcessWithScheduleGUI.php.
References ILIAS\Repository\ctrl(), ilDatePresentation\formatPeriod(), IL_CAL_UNIX, and ILIAS\Repository\lng().
Referenced by processNumberForm(), and showNumberForm().
275 $counter = $this->reservation->getAvailableNr($this->book_request->getObjectId(), $from, $to);
280 $this->
ctrl->setParameter($this,
"slot", $from .
"_" . $to);
281 $form = $this->gui->form([self::class],
"processNumberForm")
285 $this->
lng->txt(
"book_confirm_booking_schedule_number_of_objects"),
286 $this->
lng->txt(
"book_confirm_booking_schedule_number_of_objects_info")
288 ->number(
"nr", $period,
"", 1, 1, $counter)
289 ->radio(
"recurrence", $this->
lng->txt(
"book_recurrence"),
"",
"0")
290 ->radioOption(
"0", $this->
lng->txt(
"book_no_recurrence"))
291 ->radioOption(
"1", $this->
lng->txt(
"book_book_recurrence"));
292 if ($this->pool->usesMessages()) {
293 $form = $form->textarea(
295 $this->
lng->txt(
"book_message"),
296 $this->
lng->txt(
"book_message_info")
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false)
Format a period of two dates Shows: 14.
◆ getRecurrenceForm()
| ilBookingProcessWithScheduleGUI::getRecurrenceForm |
( |
| ) |
|
|
protected |
Definition at line 356 of file class.ilBookingProcessWithScheduleGUI.php.
References IL_CAL_UNIX, and ILIAS\Repository\lng().
Referenced by checkAvailability(), and processNumberForm().
358 $this->
lng->loadLanguageModule(
"dateplaner");
360 $form = $this->gui->form([self::class],
"checkAvailability")
363 $this->
lng->txt(
"book_confirm_booking_schedule_number_of_objects"),
364 $this->
lng->txt(
"book_confirm_booking_schedule_number_of_objects_info")
366 ->
switch(
"recurrence", $this->
lng->txt(
"cal_recurrences"),
"",
"1")
367 ->group(
"1", $this->
lng->txt(
"cal_weekly"))
368 ->date(
"until1", $this->
lng->txt(
"cal_repeat_until"),
"", $today)
369 ->group(
"2", $this->
lng->txt(
"r_14"))
370 ->date(
"until2", $this->
lng->txt(
"cal_repeat_until"),
"", $today)
371 ->group(
"4", $this->
lng->txt(
"r_4_weeks"))
372 ->date(
"until4", $this->
lng->txt(
"cal_repeat_until"),
"", $today)
◆ processNumberForm()
| ilBookingProcessWithScheduleGUI::processNumberForm |
( |
| ) |
|
Definition at line 302 of file class.ilBookingProcessWithScheduleGUI.php.
References $message, checkAvailability(), ILIAS\Repository\ctrl(), getBookgingObjectTitle(), getNumberForm(), and getRecurrenceForm().
304 $this->log->debug(
"processNumberForm");
306 if ($this->book_request->getBookedUser() > 0) {
307 $this->user_id_to_book = $this->book_request->getBookedUser();
309 $slot = $this->book_request->getSlot();
310 $from = $this->book_request->getSlotFrom();
311 $to = $this->book_request->getSlotTo();
312 $obj_id = $this->book_request->getObjectId();
314 if ($this->user_id_assigner !== $this->user_id_to_book) {
315 $this->
ctrl->setParameterByClass(self::class,
"bkusr", $this->user_id_to_book);
317 $this->
ctrl->setParameterByClass(self::class,
"slot", $slot);
321 if (!$form->isValid()) {
327 $message = $this->pool->usesMessages()
328 ? $form->getData(
"message")
332 $recurrence = $form->getData(
"recurrence");
333 if ($recurrence ===
"1") {
334 if ($this->pool->usesMessages()) {
335 $this->
ctrl->setParameterByClass(
341 $this->
ctrl->setParameterByClass(self::class,
"object_id", $this->book_request->getObjectId());
342 $this->
ctrl->setParameterByClass(self::class,
"nr", (
int) $form->getData(
"nr"));
350 $form->getData(
"nr"),
checkAvailability(bool $incl_recurrence=true, int $nr=0, string $message="")
getNumberForm(int $from, int $to)
◆ selectObjects()
| ilBookingProcessWithScheduleGUI::selectObjects |
( |
| ) |
|
|
protected |
◆ showNumberForm()
| ilBookingProcessWithScheduleGUI::showNumberForm |
( |
| ) |
|
◆ week()
| ilBookingProcessWithScheduleGUI::week |
( |
| ) |
|
First step in booking process.
Definition at line 144 of file class.ilBookingProcessWithScheduleGUI.php.
References Vendor\Package\$bar, $seed, $tpl, ilCalendarUserSettings\_getInstanceByUserId(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), ilGlobalTemplateInterface\setContent(), ilGlobalTemplateInterface\setRightContent(), and ILIAS\Repository\user().
147 $this->log->debug(
"Step 0, week");
152 $this->util_gui->setHelpId(
"week");
153 $this->
ctrl->setParameter($this,
'returnCmd',
"week");
155 if ($this->user_id_to_book !== $this->user_id_assigner) {
156 $this->
ctrl->setParameter($this,
'bkusr', $this->user_id_to_book);
160 $week_gui = new \ILIAS\BookingManager\BookingProcess\WeekGUI(
163 $this->object_selection->getSelectedObjects(),
164 $this->pool->getId(),
166 $user_settings->getWeekStart()
170 $bar = $this->gui->toolbar();
171 $list_link = $this->
ctrl->getLinkTargetByClass(
"ilObjBookingPoolGUI",
"render");
172 $week_link = $this->
ctrl->getLinkTargetByClass(
"ilBookingProcessWithScheduleGUI",
"week");
173 $mode_control = $this->gui->ui()->factory()->viewControl()->mode([
174 $this->
lng->txt(
"book_list") => $list_link,
175 $this->
lng->txt(
"book_week") => $week_link
176 ], $this->
lng->txt(
"book_view"))->withActive($this->
lng->txt(
"book_week"));
177 $bar->addComponent($mode_control);
179 $list_gui = new \ILIAS\BookingManager\BookingProcess\ObjectSelectionListGUI(
180 $this->pool->getId(),
181 $this->
ctrl->getFormAction($this,
"selectObjects")
static _getInstanceByUserId(int $a_user_id)
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
setRightContent(string $a_html)
Sets content of right column.
◆ $access
◆ $book_obj_id
| int ilBookingProcessWithScheduleGUI::$book_obj_id |
|
protected |
◆ $book_request
| ILIAS BookingManager StandardGUIRequest ilBookingProcessWithScheduleGUI::$book_request |
|
protected |
◆ $booking_object_id
| int ilBookingProcessWithScheduleGUI::$booking_object_id |
|
protected |
◆ $context_obj_id
| int ilBookingProcessWithScheduleGUI::$context_obj_id |
|
protected |
◆ $ctrl
| ilCtrl ilBookingProcessWithScheduleGUI::$ctrl |
|
protected |
◆ $gui
| ILIAS BookingManager InternalGUIService ilBookingProcessWithScheduleGUI::$gui |
|
protected |
◆ $help
◆ $http
| ILIAS HTTP Services ilBookingProcessWithScheduleGUI::$http |
|
protected |
◆ $lng
◆ $log
| ilLogger ilBookingProcessWithScheduleGUI::$log |
|
protected |
◆ $object_manager
| ILIAS BookingManager Objects ObjectsManager ilBookingProcessWithScheduleGUI::$object_manager |
|
protected |
◆ $object_selection
| ILIAS BookingManager BookingProcess ObjectSelectionManager ilBookingProcessWithScheduleGUI::$object_selection |
|
protected |
◆ $pool
◆ $process
| ILIAS BookingManager BookingProcess BookingProcessManager ilBookingProcessWithScheduleGUI::$process |
|
protected |
◆ $raw_post_data
| array ilBookingProcessWithScheduleGUI::$raw_post_data |
|
protected |
◆ $repo
| ILIAS BookingManager InternalRepoService ilBookingProcessWithScheduleGUI::$repo |
|
protected |
◆ $reservation
| ILIAS BookingManager Reservations ReservationManager ilBookingProcessWithScheduleGUI::$reservation |
|
protected |
◆ $rsv_ids
| array ilBookingProcessWithScheduleGUI::$rsv_ids = [] |
|
protected |
◆ $seed
| string ilBookingProcessWithScheduleGUI::$seed |
|
protected |
◆ $tabs_gui
| ilTabsGUI ilBookingProcessWithScheduleGUI::$tabs_gui |
|
protected |
◆ $tpl
◆ $user
| ilObjUser ilBookingProcessWithScheduleGUI::$user |
|
protected |
◆ $user_id_assigner
| int ilBookingProcessWithScheduleGUI::$user_id_assigner |
|
protected |
◆ $user_id_to_book
| int ilBookingProcessWithScheduleGUI::$user_id_to_book |
|
protected |
◆ $util_gui
| ILIAS BookingManager BookingProcess ProcessUtilGUI ilBookingProcessWithScheduleGUI::$util_gui |
|
protected |
The documentation for this class was generated from the following file: