58 $this->tpl =
$DIC->ui()->mainTemplate();
59 $this->
tabs = $DIC->tabs();
60 $this->
ctrl = $DIC->ctrl();
61 $this->
lng = $DIC->language();
62 $this->
access = $DIC->bookingManager()->internal()->domain()->access();
63 $this->
help = $DIC[
'ilHelp'];
64 $this->obj_data_cache =
$DIC[
'ilObjDataCache'];
66 $this->ui_factory =
$DIC->ui()->factory();
67 $this->ui_renderer =
$DIC->ui()->renderer();
69 $this->booking_manager =
$DIC->bookingManager();
70 $this->
toolbar = $DIC->toolbar();
71 $this->data_factory =
new Factory();
73 $this->ref_id = $a_parent_obj->
getRefId();
74 $this->book_request =
$DIC->bookingManager()->internal()->gui()->standardRequest();
75 $this->schedule_id = $this->book_request->getScheduleId();
77 if ($this->schedule_id > 0) {
84 switch ($this->
ctrl->getNextClass($this)) {
86 $cmd = $this->
ctrl->getCmd(
'render');
87 if (method_exists($this, $cmd)) {
96 $pool_id = $this->obj_data_cache->lookupObjId($this->ref_id);
97 $schedule_manager = $this->booking_manager->internal()->domain()->schedules($pool_id);
105 $pool_id = $this->obj_data_cache->lookupObjId($this->ref_id);
106 $schedule_manager = $this->booking_manager->internal()->domain()->schedules($pool_id);
110 if ($this->
access->canManageSettings($this->ref_id)) {
112 $this->ui_factory->button()->standard(
113 $this->lng->txt(
'book_add_schedule'),
114 $this->ctrl->getLinkTarget($this,
'create')
119 $this->tpl->setContent(
120 $this->ui_renderer->render(
121 $this->configureScheduleTable($schedule_manager)->getComponents($this->getTableActionUrlBuilder())
128 $this->
tabs->clearTargets();
129 $this->
tabs->setBackTarget($this->
lng->txt(
'book_back_to_list'), $this->ctrl->getLinkTarget($this,
'render'));
130 $this->
help->setScreenIdComponent(
'book');
131 $this->
help->setScreenId(
'schedules');
132 $this->
help->setSubScreenId(
'create');
133 $this->tpl->setContent($this->
initForm()->getHTML());
138 $this->
tabs->clearTargets();
139 $this->
tabs->setBackTarget($this->
lng->txt(
'book_back_to_list'), $this->ctrl->getLinkTarget($this,
'render'));
140 $this->
help->setScreenIdComponent(
'book');
141 $this->
help->setScreenId(
'schedules');
142 $this->
help->setSubScreenId(
'edit');
143 $this->tpl->setContent($this->
initForm(
'edit', $this->schedule_id)->getHTML());
148 $this->
lng->loadLanguageModule(
'dateplaner');
153 $title->setRequired(
true);
155 $title->setMaxLength(120);
156 $form_gui->addItem($title);
162 $radio->setValue($schedule_type);
163 $radio->setRequired(
true);
167 $definition_slots->setInfo($this->
lng->txt(
'book_schedule_days_info'));
168 $definition_slots->setRequired(
true);
169 $opt_time_period->addSubItem($definition_slots);
170 $radio->addOption($opt_time_period);
174 $definition_all_day->setRequired(
true);
175 $opt_all_days->addSubItem($definition_all_day);
176 $radio->addOption($opt_all_days);
178 $form_gui->addItem($radio);
181 $deadline_opts->setRequired(
true);
182 $form_gui->addItem($deadline_opts);
184 $deadline_time =
new ilRadioOption($this->
lng->txt(
'book_deadline_hours'),
'hours');
185 $deadline_opts->addOption($deadline_time);
188 $deadline->setInfo($this->
lng->txt(
'book_deadline_info'));
189 $deadline->setSuffix($this->
lng->txt(
'book_hours'));
190 $deadline->setMinValue(1);
191 $deadline->setSize(3);
192 $deadline->setMaxLength(3);
193 $deadline->setRequired(
true);
194 $deadline_time->addSubItem($deadline);
196 $deadline_start =
new ilRadioOption($this->
lng->txt(
'book_deadline_slot_start'),
'slot_start');
197 $deadline_opts->addOption($deadline_start);
199 $deadline_slot =
new ilRadioOption($this->
lng->txt(
'book_deadline_slot_end'),
'slot_end');
200 $deadline_opts->addOption($deadline_slot);
203 $av->setTitle($this->
lng->txt(
'obj_activation_list_gui'));
204 $form_gui->addItem($av);
207 $this->
lng->loadLanguageModule(
'rep');
210 $from->setShowTime(
true);
211 $form_gui->addItem($from);
214 $to->setShowTime(
true);
215 $form_gui->addItem($to);
218 $form_gui->setTitle($this->
lng->txt(
'book_edit_schedule'));
221 $item->setValue(
$id);
222 $form_gui->addItem($item);
224 $title->setValue($schedule->getTitle());
225 $from->setDate($schedule->getAvailabilityFrom());
226 $to->setDate($schedule->getAvailabilityTo());
228 if ($schedule->getDeadline() === 0) {
229 $deadline_opts->setValue(
'slot_start');
230 } elseif ($schedule->getDeadline() > 0) {
231 $deadline->setValue($schedule->getDeadline());
232 $deadline_opts->setValue(
'hours');
234 $deadline->setValue(0);
235 $deadline_opts->setValue(
'slot_end');
238 match ($schedule_type) {
242 default => $definition_slots->setValue($schedule->getDefinitionBySlots()),
245 $form_gui->addCommandButton(
'update', $this->
lng->txt(
'save'));
247 $form_gui->setTitle($this->
lng->txt(
'book_add_schedule'));
248 $form_gui->addCommandButton(
'save', $this->
lng->txt(
'save'));
249 $form_gui->addCommandButton(
'render', $this->
lng->txt(
'cancel'));
251 $form_gui->setFormAction($this->
ctrl->getFormAction($this));
260 if ($form->checkInput()) {
265 $this->tpl->setOnScreenMessage(
267 $this->
lng->txt(
'book_schedule_added'),
270 $this->
ctrl->redirect($this,
'render');
274 $form->setValuesByPost();
275 $this->tpl->setContent($form->getHTML());
280 $form = $this->
initForm(
'edit', $this->schedule_id);
282 if ($form->checkInput()) {
287 $this->tpl->setOnScreenMessage(
289 $this->
lng->txt(
'book_schedule_updated'),
292 $this->
ctrl->redirect($this,
'render');
296 $form->setValuesByPost();
297 $this->tpl->setContent($form->getHTML());
303 $schedule->
setPoolId($this->obj_data_cache->lookupObjId($this->ref_id));
307 if ($from !==
null) {
316 match ($form->
getInput(
'deadline_opts')) {
358 return new URLBuilder($this->data_factory->uri(
359 ILIAS_HTTP_PATH .
'/' . $this->ctrl->getLinkTargetByClass(self::class,
'executeTableAction')
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Builds a Color from either hex- or rgb values.
static getList(int $a_pool_id, ?string $a_title=null)
Get list of booking objects.
@ilCtrl_Calls ilBookingScheduleGUI:
configureScheduleTable(ScheduleManager $schedule_manager)
readonly Refinery $refinery
readonly HttpService $http
readonly UIFactory $ui_factory
readonly ilToolbarGUI $toolbar
StandardGUIRequest $book_request
__construct(ilObjBookingPoolGUI $a_parent_obj)
readonly BookingManager $booking_manager
getTableActionUrlBuilder()
initForm(string $a_mode='create', ?int $id=null)
ilObjectDataCache $obj_data_cache
checkForInfoMessageAboutMissingBookableItems(ScheduleManager $schedule_manager, int $pool_id)
readonly UIRenderer $ui_renderer
readonly Factory $data_factory
ilGlobalTemplateInterface $tpl
formToObject(ilPropertyFormGUI $form, ilBookingSchedule $schedule)
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)
const SCHEDULE_TYPE_TIME_PERIOD
setTitle(string $a_title)
setScheduleType(string $a_schedule_type)
setDefinitionBySlots(array $a_def)
const SCHEDULE_TYPE_ALL_DAY
setDeadline(int $a_deadline)
Set deadline.
setAvailabilityTo(?ilDateTime $a_date=null)
Class ilCtrl provides processing control methods.
@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.
const MESSAGE_TYPE_SUCCESS
An entity that renders components to a string output.
static http()
Fetches the global http state from ILIAS.