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);
176 $form_gui->addItem($deadline_opts);
178 $deadline_time =
new ilRadioOption($lng->
txt(
"book_deadline_hours"),
"hours");
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);
190 $deadline_start =
new ilRadioOption($lng->
txt(
"book_deadline_slot_start"),
"slot_start");
191 $deadline_opts->addOption($deadline_start);
193 $deadline_slot =
new ilRadioOption($lng->
txt(
"book_deadline_slot_end"),
"slot_end");
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);
209 $form_gui->addItem($from);
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));
256 if ($form->checkInput()) {
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()) {
280 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"book_schedule_updated"));
283 $form->setValuesByPost();
298 $schedule->
setPoolId($ilObjDataCache->lookupObjId($this->ref_id));
301 if ($from !==
null) {
310 switch ($form->
getInput(
"deadline_opts")) {
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 381 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
'book_schedule_deleted'),
true);
382 $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)