20 $this->ref_id = $a_parent_obj->ref_id;
30 $next_class = $ilCtrl->getNextClass($this);
35 $cmd = $ilCtrl->getCmd(
"render");
51 include_once
'Modules/BookingManager/classes/class.ilBookingSchedulesTableGUI.php';
54 if ($ilAccess->checkAccess(
'write',
'', $this->ref_id))
57 if(
sizeof($table->getData()))
59 include_once
"Modules/BookingManager/classes/class.ilBookingObject.php";
66 include_once
'Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
68 $bar->
addButton($lng->txt(
'book_add_schedule'), $ilCtrl->getLinkTarget($this,
'create'));
69 $bar = $bar->getHTML();
72 $tpl->setContent($bar.$table->getHTML());
82 $ilTabs->clearTargets();
83 $ilTabs->setBackTarget($lng->txt(
'book_back_to_list'), $ilCtrl->getLinkTarget($this,
'render'));
84 $ilHelp->setScreenIdComponent(
"book");
85 $ilHelp->setScreenId(
"schedules");
86 $ilHelp->setSubScreenId(
"create");
89 $tpl->setContent($form->getHTML());
99 $ilTabs->clearTargets();
100 $ilTabs->setBackTarget($lng->txt(
'book_back_to_list'), $ilCtrl->getLinkTarget($this,
'render'));
101 $ilHelp->setScreenIdComponent(
"book");
102 $ilHelp->setScreenId(
"schedules");
103 $ilHelp->setSubScreenId(
"edit");
106 $tpl->setContent($form->getHTML());
119 $lng->loadLanguageModule(
"dateplaner");
121 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
128 $title->setMaxLength(120);
129 $form_gui->addItem($title);
173 include_once
"Modules/BookingManager/classes/class.ilScheduleInputGUI.php";
175 $definition->
setInfo($lng->txt(
"book_schedule_days_info"));
176 $definition->setRequired(
true);
177 $form_gui->addItem($definition);
180 $deadline->
setInfo($lng->txt(
"book_deadline_info"));
181 $deadline->setSuffix($lng->txt(
"book_hours"));
182 $deadline->setMinValue(0);
183 $deadline->setSize(3);
184 $deadline->setMaxLength(3);
185 $form_gui->addItem($deadline);
187 if ($a_mode ==
"edit")
189 $form_gui->setTitle($lng->txt(
"book_edit_schedule"));
192 $item->setValue($id);
193 $form_gui->addItem($item);
195 include_once
'Modules/BookingManager/classes/class.ilBookingSchedule.php';
197 $title->setValue($schedule->getTitle());
198 $deadline->setValue($schedule->getDeadline());
215 $definition->setValue($schedule->getDefinitionBySlots());
217 $form_gui->addCommandButton(
"update", $lng->txt(
"save"));
221 $form_gui->setTitle($lng->txt(
"book_add_schedule"));
222 $form_gui->addCommandButton(
"save", $lng->txt(
"save"));
223 $form_gui->addCommandButton(
"render", $lng->txt(
"cancel"));
225 $form_gui->setFormAction($ilCtrl->getFormAction($this));
238 if($form->checkInput())
240 include_once
'Modules/BookingManager/classes/class.ilBookingSchedule.php';
250 $form->setValuesByPost();
252 $tpl->setContent($form->getHTML());
264 if($form->checkInput())
266 include_once
'Modules/BookingManager/classes/class.ilBookingSchedule.php';
276 $form->setValuesByPost();
278 $tpl->setContent($form->getHTML());
293 foreach($days_group->getOptions() as $option)
295 $days_fields[$option->getValue()] = $option;
298 foreach($days as $day)
300 $slot = $form->
getInput($day.
"_slot");
301 $subs = $days_fields[$day]->getSubItems();
304 $subs[0]->setValue($slot[0]);
308 $subs[1]->setValue($slot[1]);
321 global $ilObjDataCache;
323 $schedule->setTitle($form->getInput(
"title"));
324 $schedule->setPoolId($ilObjDataCache->lookupObjId($this->ref_id));
325 $schedule->setDeadline($form->getInput(
"deadline"));
354 $ilHelp->setSubScreenId(
"delete");
357 include_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
359 $conf->setFormAction($ilCtrl->getFormAction($this));
360 $conf->setHeaderText($lng->txt(
'book_confirm_delete'));
362 include_once
'Modules/BookingManager/classes/class.ilBookingSchedule.php';
364 $conf->addItem(
'schedule_id', (
int)$_GET[
'schedule_id'], $type->getTitle());
365 $conf->setConfirm($lng->txt(
'delete'),
'delete');
366 $conf->setCancel($lng->txt(
'cancel'),
'render');
368 $tpl->setContent($conf->getHTML());
378 include_once
'Modules/BookingManager/classes/class.ilBookingSchedule.php';
383 $ilCtrl->redirect($this,
'render');