27 protected \ILIAS\BookingManager\Reservations\ReservationManager
$reservation;
28 protected \ILIAS\BookingManager\BookingProcess\ProcessUtilGUI
$util_gui;
29 protected \ILIAS\BookingManager\InternalRepoService
$repo;
30 protected \ILIAS\BookingManager\BookingProcess\BookingProcessManager
$process;
31 protected \ILIAS\HTTP\Services
$http;
32 protected \ILIAS\BookingManager\InternalGUIService
$gui;
52 int $booking_object_id,
53 int $context_obj_id = 0
57 $this->
ctrl = $DIC->ctrl();
58 $this->tpl = $DIC[
"tpl"];
59 $this->
lng = $DIC->language();
60 $this->
access = $DIC->access();
61 $this->tabs_gui = $DIC->tabs();
62 $this->
user = $DIC->user();
63 $this->
help = $DIC->bookingManager()->internal()
64 ->gui()->bookingHelp($pool);
65 $this->
http = $DIC->http();
73 $this->book_request = $DIC->bookingManager()
78 $this->gui = $DIC->bookingManager()
82 $this->repo = $DIC->bookingManager()
86 $this->rsv_ids = $this->book_request->getReservationIdsFromString();
88 $this->raw_post_data = $DIC->http()->request()->getParsedBody();
90 $this->user_id_assigner = $this->
user->getId();
91 if ($this->book_request->getBookedUser() > 0) {
92 $this->user_id_to_book = $this->book_request->getBookedUser();
96 $this->
ctrl->saveParameter($this, [
"bkusr",
"returnCmd"]);
98 $this->process = $DIC->bookingManager()->internal()->domain()->process();
99 $this->reservation = $DIC->bookingManager()->internal()->domain()->reservations();
100 $this->util_gui = $DIC->bookingManager()->internal()->gui()->process()->ProcessUtilGUI(
111 $cmd = $ctrl->
getCmd(
"show");
112 switch ($next_class) {
114 if (in_array($cmd, array(
117 "assignParticipants",
118 "bookMultipleParticipants",
119 "saveMultipleBookings",
123 "redirectToParticipantsList",
144 $this->tabs_gui->clearTargets();
145 $this->tabs_gui->setBackTarget($this->
lng->txt(
'book_back_to_list'), $this->
ctrl->getLinkTarget($this,
'back'));
147 $this->util_gui->setHelpId(
"book");
151 $this->
lng->loadLanguageModule(
"dateplaner");
152 $this->
ctrl->setParameter($this,
'object_id', $obj->getId());
153 $this->
ctrl->setParameter($this,
'returnCmd',
"back");
155 if ($this->user_id_to_book !== $this->user_id_assigner) {
156 $this->
ctrl->setParameter($this,
'bkusr', $this->user_id_to_book);
159 if ($this->pool->usesMessages()) {
169 return $this->gui->form([self::class],
"saveMessage", $this->
lng->txt(
"book_book"))
170 ->section(
"main", $this->
lng->txt(
"book_booking") .
": " . $obj->getTitle())
173 $this->
lng->txt(
"book_message"),
174 $this->
lng->txt(
"book_message_info")
185 $this->
ctrl->saveParameter($this, [
'object_id',
'returnCmd',
'bkusr']);
187 if (!$form->isValid()) {
188 $this->tabs_gui->clearTargets();
189 $this->tabs_gui->setBackTarget($this->
lng->txt(
'book_back_to_list'), $this->
ctrl->getLinkTarget($this,
'back'));
190 $this->tpl->setContent($form->render());
203 $cgui->setHeaderText($this->
lng->txt(
"book_confirm_booking_no_schedule"));
205 $cgui->setFormAction($this->
ctrl->getFormAction($this));
206 $cgui->setCancel($this->
lng->txt(
"cancel"),
"back");
207 $cgui->setConfirm($this->
lng->txt(
"confirm"),
"confirmedBooking");
209 $cgui->addItem(
"object_id", $obj->getId(), $obj->getTitle());
217 $this->util_gui->assignParticipants($this->book_obj_id);
225 $participants = $this->book_request->getParticipants();
226 if (count($participants) === 0) {
227 $this->util_gui->back();
231 $this->tabs_gui->clearTargets();
232 $this->tabs_gui->setBackTarget($this->
lng->txt(
"back"), $this->
ctrl->getLinkTarget($this,
'assignparticipants'));
235 $conf->setFormAction($this->
ctrl->getFormAction($this));
238 foreach ($participants as
$id) {
240 $conf->addItem(
"participants[]", $id, $name);
244 if (count($participants) > $available) {
246 $this->tpl->setOnScreenMessage(
"failure", sprintf(
247 $this->
lng->txt(
'book_limit_objects_available'),
248 count($participants),
252 $this->
ctrl->redirect($this,
"redirectToParticipantsList");
254 $conf->setHeaderText($this->
lng->txt(
'book_confirm_booking_no_schedule'));
255 $conf->addHiddenItem(
"object_id", $this->book_obj_id);
256 $conf->setConfirm($this->
lng->txt(
"assign"),
"saveMultipleBookings");
259 $conf->setCancel($this->
lng->txt(
"cancel"),
'redirectToParticipantsList');
260 $this->tpl->setContent($conf->getHTML());
265 $this->
ctrl->redirect($this,
'assignParticipants');
274 $participants = $this->book_request->getParticipants();
275 $object_id = $this->book_request->getObjectId();
276 if (count($participants) > 0 && $object_id > 0) {
277 $this->book_obj_id = $object_id;
279 $this->util_gui->back();
282 foreach ($participants as
$id) {
283 $this->user_id_to_book =
$id;
284 $rsv_ids[] = $this->process->bookSingle(
286 $this->user_id_to_book,
287 $this->user_id_assigner,
288 $this->context_obj_id
292 if (count($rsv_ids)) {
293 $this->tpl->setOnScreenMessage(
'success',
"booking_multiple_succesfully");
295 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'book_reservation_failed_overbooked'),
true);
297 $this->util_gui->back();
311 if ($this->book_obj_id > 0) {
316 $rsv_ids[] = $this->process->bookSingle(
318 $this->user_id_to_book,
319 $this->user_id_assigner,
320 $this->context_obj_id,
326 $success = $object_id;
329 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'book_reservation_failed_overbooked'),
true);
330 $this->
ctrl->redirect($this,
'back');
336 $this->util_gui->handleBookingSuccess($success,
"displayPostInfo", $rsv_ids);
338 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'book_reservation_failed'),
true);
339 $this->
ctrl->redirect($this,
'book');
346 $this->util_gui->displayPostInfo(
348 $this->user_id_assigner,
355 $this->util_gui->deliverPostFile(
357 $this->user_id_assigner
363 $this->
ctrl->redirectByClass(\ilObjBookingPoolGUI::class,
'render');
Booking process ui class.
bookMultipleParticipants()
Create reservations for a bunch of booking pool participants.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS HTTP Services $http
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
book()
Triggered from object list week view for booking a single object / confirmation for.
static _lookupFullname(int $a_user_id)
getCmd(string $fallback_command=null)
ilGlobalTemplateInterface $tpl
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider .
static getObjectReservationForUser(int $a_object_id, int $a_user_id)
redirectToParticipantsList()
ILIAS BookingManager BookingProcess BookingProcessManager $process
saveMultipleBookings()
Save multiple users reservations for one booking pool object.
confirmedBooking($message="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS BookingManager Reservations ReservationManager $reservation
ILIAS BookingManager InternalGUIService $gui
ILIAS BookingManager InternalRepoService $repo
getNextClass($a_gui_class=null)
static http()
Fetches the global http state from ILIAS.
setContent(string $a_html)
Sets content for standard template.
ilBookingHelpAdapter $help
__construct(ilObjBookingPool $pool, int $booking_object_id, int $context_obj_id=0)
static numAvailableFromObjectNoSchedule(int $a_obj_id)
static isObjectAvailableNoSchedule(int $a_obj_id)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
ILIAS BookingManager StandardGUIRequest $book_request
ILIAS BookingManager BookingProcess ProcessUtilGUI $util_gui