27 protected \ILIAS\BookingManager\Access\AccessManager
$access;
43 $this->tpl =
$DIC->ui()->mainTemplate();
44 $this->
tabs = $DIC->tabs();
45 $this->
ctrl = $DIC->ctrl();
46 $this->
lng = $DIC->language();
47 $this->
access = $DIC->bookingManager()->internal()->domain()->access();
48 $this->
help = $DIC[
"ilHelp"];
49 $this->obj_data_cache =
$DIC[
"ilObjDataCache"];
50 $this->ref_id = $a_parent_obj->
getRefId();
51 $this->book_request =
$DIC->bookingManager()
55 $this->schedule_id = $this->book_request->getScheduleId();
57 if ($this->schedule_id > 0) {
58 $this->
access->validateScheduleId(
71 switch ($next_class) {
73 $cmd = $ilCtrl->getCmd(
"render");
91 if ($this->
access->canManageSettings($this->ref_id)) {
93 if (count($table->getData())) {
95 $this->tpl->setOnScreenMessage(
'info',
$lng->
txt(
"book_type_warning"));
100 $bar->addButton(
$lng->
txt(
'book_add_schedule'), $ilCtrl->getLinkTarget($this,
'create'));
118 $ilTabs->clearTargets();
119 $ilTabs->setBackTarget(
$lng->
txt(
'book_back_to_list'), $ilCtrl->getLinkTarget($this,
'render'));
121 $ilHelp->setScreenId(
"schedules");
122 $ilHelp->setSubScreenId(
"create");
139 $ilTabs->clearTargets();
140 $ilTabs->setBackTarget(
$lng->
txt(
'book_back_to_list'), $ilCtrl->getLinkTarget($this,
'render'));
142 $ilHelp->setScreenId(
"schedules");
143 $ilHelp->setSubScreenId(
"edit");
145 $form = $this->
initForm(
'edit', $this->schedule_id);
153 string $a_mode =
"create",
164 $title->setRequired(
true);
166 $title->setMaxLength(120);
167 $form_gui->addItem($title);
170 $definition->setInfo(
$lng->
txt(
"book_schedule_days_info"));
171 $definition->setRequired(
true);
172 $form_gui->addItem($definition);
175 $deadline_opts->setRequired(
true);
176 $form_gui->addItem($deadline_opts);
179 $deadline_opts->addOption($deadline_time);
182 $deadline->setInfo(
$lng->
txt(
"book_deadline_info"));
183 $deadline->setSuffix(
$lng->
txt(
"book_hours"));
184 $deadline->setMinValue(1);
185 $deadline->setSize(3);
186 $deadline->setMaxLength(3);
187 $deadline->setRequired(
true);
188 $deadline_time->addSubItem($deadline);
191 $deadline_opts->addOption($deadline_start);
194 $deadline_opts->addOption($deadline_slot);
196 if ($a_mode ===
"edit") {
201 $av->setTitle(
$lng->
txt(
"obj_activation_list_gui"));
202 $form_gui->addItem($av);
208 $from->setShowTime(
true);
209 $form_gui->addItem($from);
212 $to->setShowTime(
true);
213 $form_gui->addItem($to);
215 if ($a_mode ===
"edit") {
216 $form_gui->setTitle(
$lng->
txt(
"book_edit_schedule"));
219 $item->setValue(
$id);
220 $form_gui->addItem($item);
223 $title->setValue($schedule->getTitle());
224 $from->setDate($schedule->getAvailabilityFrom());
225 $to->setDate($schedule->getAvailabilityTo());
227 if ($schedule->getDeadline() === 0) {
228 $deadline_opts->setValue(
"slot_start");
229 } elseif ($schedule->getDeadline() > 0) {
230 $deadline->setValue($schedule->getDeadline());
231 $deadline_opts->setValue(
"hours");
233 $deadline->setValue(0);
234 $deadline_opts->setValue(
"slot_end");
237 $definition->setValue($schedule->getDefinitionBySlots());
239 $form_gui->addCommandButton(
"update",
$lng->
txt(
"save"));
241 $form_gui->setTitle(
$lng->
txt(
"book_add_schedule"));
242 $form_gui->addCommandButton(
"save",
$lng->
txt(
"save"));
243 $form_gui->addCommandButton(
"render",
$lng->
txt(
"cancel"));
245 $form_gui->setFormAction($ilCtrl->getFormAction($this));
255 $form = $this->initForm();
256 if ($form->checkInput()) {
258 $this->formToObject($form, $obj);
261 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"book_schedule_added"));
264 $form->setValuesByPost();
274 $form = $this->initForm(
'edit', $this->schedule_id);
275 if ($form->checkInput()) {
277 $this->formToObject($form, $obj);
280 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
"book_schedule_updated"));
283 $form->setValuesByPost();
295 $ilObjDataCache = $this->obj_data_cache;
298 $schedule->
setPoolId($ilObjDataCache->lookupObjId($this->ref_id));
301 if ($from !==
null) {
310 switch ($form->
getInput(
"deadline_opts")) {
350 $ilCtrl = $this->ctrl;
353 $ilHelp = $this->help;
355 $ilHelp->setSubScreenId(
"delete");
359 $conf->setFormAction($ilCtrl->getFormAction($this));
360 $conf->setHeaderText(
$lng->txt(
'book_confirm_delete'));
363 $conf->addItem(
'schedule_id', $this->schedule_id, $type->getTitle());
364 $conf->setConfirm(
$lng->txt(
'delete'),
'delete');
365 $conf->setCancel(
$lng->txt(
'cancel'),
'render');
373 public function delete():
void
375 $ilCtrl = $this->ctrl;
381 $this->tpl->setOnScreenMessage(
'success',
$lng->txt(
'book_schedule_deleted'),
true);
382 $ilCtrl->redirect($this,
'render');
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static getList(int $a_pool_id, ?string $a_title=null)
Get list of booking objects.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
render()
Render list of booking schedules uses ilBookingSchedulesTableGUI.
create()
Render creation form.
initForm(string $a_mode="create", ?int $id=null)
Build property form.
ILIAS BookingManager StandardGUIRequest $book_request
ILIAS BookingManager Access AccessManager $access
__construct(ilObjBookingPoolGUI $a_parent_obj)
ilObjectDataCache $obj_data_cache
confirmDelete()
Confirm delete.
ilGlobalTemplateInterface $tpl
formToObject(ilPropertyFormGUI $form, ilBookingSchedule $schedule)
Set form data into schedule object.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setAvailabilityFrom(?ilDateTime $a_date=null)
setPoolId(int $a_pool_id)
setTitle(string $a_title)
setDefinitionBySlots(array $a_def)
setDeadline(int $a_deadline)
Set deadline.
setAvailabilityTo(?ilDateTime $a_date=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
getNextClass($a_gui_class=null)
@inheritDoc
setScreenIdComponent(string $a_comp)
loadLanguageModule(string $a_module)
Load language module.
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...
@ilCtrl_Calls ilObjBookingPoolGUI: ilPermissionGUI, ilBookingObjectGUI @ilCtrl_Calls ilObjBookingPool...
static _lookupObjId(int $ref_id)
This class represents an option in a radio group.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text property in a property form.
setContent(string $a_html)
Sets content for standard template.