3 declare(strict_types=1);
39 $lng = $domain->lng();
40 $lng->loadLanguageModule(
"book");
41 $this->objects_manager = $domain
47 $ctrl = $this->gui->ctrl();
49 $next_class = $ctrl->getNextClass($this);
50 $cmd = $ctrl->getCmd(
"showCreationForm");
52 switch ($next_class) {
56 "showConfirmationScreen",
67 $lng = $this->domain->lng();
68 $ctrl = $this->gui->ctrl();
71 ->modal(
$lng->txt(
"book_bulk_creation"))
72 ->getAsyncTriggerButtonComponents(
73 $lng->txt(
"book_bulk_creation"),
74 $ctrl->getLinkTarget($this,
"showCreationForm",
"",
true),
78 if ($type ===
"signal") {
87 $lng = $this->domain->lng();
89 ->modal(
$lng->txt(
"book_bulk_creation"))
96 $lng = $this->domain->lng();
97 $schedule_manager = $this->domain->schedules($this->pool->getId());
98 $schedules = $schedule_manager->getScheduleList();
101 ->form(self::class,
"showConfirmationScreen")
103 ->section(
"creation",
$lng->txt(
"book_bulk_data"))
106 $lng->txt(
"book_title_description_nr"),
107 $lng->txt(
"book_title_description_nr_info"),
114 $lng->txt(
"book_schedule"),
117 (string) array_key_first($schedules)
129 $lng = $this->domain->lng();
130 if (!$form->isValid()) {
131 $this->gui->modal(
$lng->txt(
"book_bulk_creation"))
138 $schedule_id = (
int) $form->getData(
"schedule_id");
140 $this->gui->modal(
$lng->txt(
"book_bulk_creation"))
142 $form->getData(
"data"),
150 $lng = $this->domain->lng();
151 $ctrl = $this->gui->ctrl();
153 $f = $this->gui->ui()->factory();
154 $r = $this->gui->ui()->renderer();
155 $button1 =
$f->button()->standard(
156 $lng->txt(
"book_create_objects"),
160 globalThis.book_bulk_button = document.getElementById(
"$id");
161 book_bulk_button.addEventListener(
"click", (
event) => {
162 book_bulk_button.closest(
".c-modal").querySelector(
".modal-body").querySelector(
"form").submit();
166 $button2 =
$f->button()->standard(
168 $ctrl->getLinkTarget($this,
"cancelCreation")
171 $mbox =
$f->messageBox()->confirmation(
172 $lng->txt(
"book_bulk_confirmation")
173 )->withButtons([$button1]);
175 $ctrl->setParameter($this,
"schedule_id", $schedule_id);
178 "renderConfirmation",
183 return $r->render($mbox) .
189 $main_tpl = $this->gui->mainTemplate();
190 $ctrl = $this->gui->ctrl();
191 $lng = $this->domain->lng();
192 $request = $this->gui->standardRequest();
194 $data = $request->getBulkCreationData();
197 $schedule_id = $request->getScheduleId();
199 $arr = $this->objects_manager->createObjectsFromBulkInputString(
$data, $schedule_id);
200 $main_tpl->setOnScreenMessage(
"success",
$lng->txt(
"msg_obj_modified"),
true);
201 $ctrl->returnToParent($this);
206 $ctrl = $this->gui->ctrl();
207 $ctrl->returnToParent($this);
Interface Observer Contains several chained tasks and infos about them.
withAdditionalOnLoadCode(Closure $binder)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS BookingManager Objects ObjectsManager $objects_manager
renderConfirmation(string $data, int $schedule_id=0)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(InternalDomainService $domain, InternalGUIService $gui, ilObjBookingPool $pool)
modifyToolbar(ilToolbarGUI $toolbar)
Author: Alexander Killing killing@leifos.de
legacy()
expected output: > ILIAS shows the rendered Component.
form( $class_path, string $cmd, string $submit_caption="")
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
InternalDomainService $domain
catch(ilCmiXapiException $e) send($response)