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();
64 switch ($next_class) {
66 $cmd = $ilCtrl->getCmd(
"render");
84 if ($this->
access->canManageSettings($this->ref_id)) {
86 if (count($table->getData())) {
88 $this->tpl->setOnScreenMessage(
'info', $lng->
txt(
"book_type_warning"));
93 $bar->addButton($lng->
txt(
'book_add_schedule'), $ilCtrl->getLinkTarget($this,
'create'));
111 $ilTabs->clearTargets();
112 $ilTabs->setBackTarget($lng->
txt(
'book_back_to_list'), $ilCtrl->getLinkTarget($this,
'render'));
114 $ilHelp->setScreenId(
"schedules");
115 $ilHelp->setSubScreenId(
"create");
132 $ilTabs->clearTargets();
133 $ilTabs->setBackTarget($lng->
txt(
'book_back_to_list'), $ilCtrl->getLinkTarget($this,
'render'));
135 $ilHelp->setScreenId(
"schedules");
136 $ilHelp->setSubScreenId(
"edit");
138 $form = $this->
initForm(
'edit', $this->schedule_id);
146 string $a_mode =
"create",
157 $title->setRequired(
true);
159 $title->setMaxLength(120);
160 $form_gui->addItem($title);
163 $definition->
setInfo($lng->
txt(
"book_schedule_days_info"));
164 $definition->setRequired(
true);
165 $form_gui->addItem($definition);
169 $form_gui->addItem($deadline_opts);
171 $deadline_time =
new ilRadioOption($lng->
txt(
"book_deadline_hours"),
"hours");
172 $deadline_opts->addOption($deadline_time);
175 $deadline->
setInfo($lng->
txt(
"book_deadline_info"));
176 $deadline->setSuffix($lng->
txt(
"book_hours"));
177 $deadline->setMinValue(1);
178 $deadline->setSize(3);
179 $deadline->setMaxLength(3);
180 $deadline_time->addSubItem($deadline);
182 $deadline_start =
new ilRadioOption($lng->
txt(
"book_deadline_slot_start"),
"slot_start");
183 $deadline_opts->addOption($deadline_start);
185 $deadline_slot =
new ilRadioOption($lng->
txt(
"book_deadline_slot_end"),
"slot_end");
186 $deadline_opts->addOption($deadline_slot);
188 if ($a_mode ===
"edit") {
193 $av->setTitle($lng->
txt(
"obj_activation_list_gui"));
194 $form_gui->addItem($av);
201 $form_gui->addItem($from);
205 $form_gui->addItem($to);
207 if ($a_mode ===
"edit") {
208 $form_gui->setTitle($lng->
txt(
"book_edit_schedule"));
211 $item->setValue(
$id);
212 $form_gui->addItem($item);
215 $title->setValue($schedule->getTitle());
216 $from->setDate($schedule->getAvailabilityFrom());
217 $to->setDate($schedule->getAvailabilityTo());
219 if ($schedule->getDeadline() === 0) {
220 $deadline_opts->setValue(
"slot_start");
221 } elseif ($schedule->getDeadline() > 0) {
222 $deadline->setValue($schedule->getDeadline());
223 $deadline_opts->setValue(
"hours");
225 $deadline->setValue(0);
226 $deadline_opts->setValue(
"slot_end");
229 $definition->setValue($schedule->getDefinitionBySlots());
231 $form_gui->addCommandButton(
"update", $lng->
txt(
"save"));
233 $form_gui->setTitle($lng->
txt(
"book_add_schedule"));
234 $form_gui->addCommandButton(
"save", $lng->
txt(
"save"));
235 $form_gui->addCommandButton(
"render", $lng->
txt(
"cancel"));
237 $form_gui->setFormAction($ilCtrl->getFormAction($this));
248 if ($form->checkInput()) {
253 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"book_schedule_added"));
256 $form->setValuesByPost();
266 $form = $this->
initForm(
'edit', $this->schedule_id);
267 if ($form->checkInput()) {
272 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"book_schedule_updated"));
275 $form->setValuesByPost();
290 $schedule->
setPoolId($ilObjDataCache->lookupObjId($this->ref_id));
293 if ($from !==
null) {
302 switch ($form->
getInput(
"deadline_opts")) {
351 $conf->setFormAction($ilCtrl->getFormAction($this));
352 $conf->setHeaderText($lng->
txt(
'book_confirm_delete'));
355 $conf->addItem(
'schedule_id', $this->schedule_id, $type->getTitle());
356 $conf->setConfirm($lng->
txt(
'delete'),
'delete');
357 $conf->setCancel($lng->
txt(
'cancel'),
'render');
365 public function delete():
void 373 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
'book_schedule_deleted'),
true);
374 $ilCtrl->redirect($this,
'render');
setDeadline(int $a_deadline)
Set deadline.
ilObjBookingPoolGUI: ilPermissionGUI, ilBookingObjectGUI ilObjBookingPoolGUI: ilBookingScheduleGUI, ilInfoScreenGUI, ilPublicUserProfileGUI ilObjBookingPoolGUI: ilCommonActionDispatcherGUI, ilObjectCopyGUI, ilObjectMetaDataGUI ilObjBookingPoolGUI: ilBookingParticipantGUI, ilBookingReservationsGUI, ilBookingPreferencesGUI ilObjBookingPoolGUI: ILIAS ilObjBookingPoolGUI: ilRepositoryGUI, ilAdministrationGUI
This class represents an option in a radio group.
initForm(string $a_mode="create", ?int $id=null)
Build property form.
ILIAS BookingManager Access AccessManager $access
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setContent(string $a_html)
Sets content for standard template.
loadLanguageModule(string $a_module)
Load language module.
ILIAS BookingManager StandardGUIRequest $book_request
__construct(ilObjBookingPoolGUI $a_parent_obj)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupObjId(int $ref_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
ilGlobalTemplateInterface $tpl
getNextClass($a_gui_class=null)
setSubScreenId(string $a_id)
setScreenIdComponent(string $a_comp)
setDefinitionBySlots(array $a_def)
static getList(int $a_pool_id, ?string $a_title=null)
Get list of booking objects.
create()
Render creation form.
formToObject(ilPropertyFormGUI $form, ilBookingSchedule $schedule)
Set form data into schedule object.
setAvailabilityTo(?ilDateTime $a_date=null)
setAvailabilityFrom(?ilDateTime $a_date=null)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
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.
confirmDelete()
Confirm delete.
setTitle(string $a_title)
ilObjectDataCache $obj_data_cache
setPoolId(int $a_pool_id)