19 declare(strict_types=1);
42 $lng = $domain->lng();
43 $lng->loadLanguageModule(
"book");
44 $this->objects_manager = $domain
50 $ctrl = $this->gui->ctrl();
52 $next_class = $ctrl->getNextClass($this);
53 $cmd = $ctrl->getCmd(
"showCreationForm");
55 switch ($next_class) {
59 "showConfirmationScreen",
70 $lng = $this->domain->lng();
71 $ctrl = $this->gui->ctrl();
74 ->modal(
$lng->txt(
"book_bulk_creation"))
75 ->getAsyncTriggerButtonComponents(
76 $lng->txt(
"book_bulk_creation"),
77 $ctrl->getLinkTarget($this,
"showCreationForm",
"",
true),
81 if ($type ===
"signal") {
90 $lng = $this->domain->lng();
92 ->modal(
$lng->txt(
"book_bulk_creation"))
99 $lng = $this->domain->lng();
100 $schedule_manager = $this->domain->schedules($this->pool->getId());
101 $schedules = $schedule_manager->getScheduleList();
104 ->form(self::class,
"showConfirmationScreen")
106 ->section(
"creation",
$lng->txt(
"book_bulk_data"))
109 $lng->txt(
"book_title_description_nr"),
110 $lng->txt(
"book_title_description_nr_info"),
117 $lng->txt(
"book_schedule"),
120 (string) array_key_first($schedules)
132 $lng = $this->domain->lng();
133 if (!$form->isValid()) {
134 $this->gui->modal(
$lng->txt(
"book_bulk_creation"))
141 $schedule_id = (
int) $form->getData(
"schedule_id");
143 $this->gui->modal(
$lng->txt(
"book_bulk_creation"))
145 $form->getData(
"data"),
153 $lng = $this->domain->lng();
154 $ctrl = $this->gui->ctrl();
156 $f = $this->gui->ui()->factory();
157 $r = $this->gui->ui()->renderer();
158 $button1 =
$f->button()->standard(
159 $lng->txt(
"book_create_objects"),
163 globalThis.book_bulk_button = document.getElementById(
"$id");
164 book_bulk_button.addEventListener(
"click", (
event) => {
165 book_bulk_button.closest(
".c-modal").querySelector(
".modal-body").querySelector(
"form").submit();
169 $button2 =
$f->button()->standard(
171 $ctrl->getLinkTarget($this,
"cancelCreation")
174 $mbox =
$f->messageBox()->confirmation(
175 $lng->txt(
"book_bulk_confirmation")
176 )->withButtons([$button1]);
178 $ctrl->setParameter($this,
"schedule_id", $schedule_id);
181 "renderConfirmation",
186 return $r->render($mbox) .
192 $main_tpl = $this->gui->mainTemplate();
193 $ctrl = $this->gui->ctrl();
194 $lng = $this->domain->lng();
195 $request = $this->gui->standardRequest();
197 $data = $request->getBulkCreationData();
200 $schedule_id = $request->getScheduleId();
202 $arr = $this->objects_manager->createObjectsFromBulkInputString(
$data, $schedule_id);
203 $main_tpl->setOnScreenMessage(
"success",
$lng->txt(
"msg_obj_modified"),
true);
204 $ctrl->returnToParent($this);
209 $ctrl = $this->gui->ctrl();
210 $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)
__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)