62 $this->tpl = $DIC[
"tpl"];
63 $this->tabs = $DIC->tabs();
64 $this->ctrl = $DIC->ctrl();
65 $this->lng = $DIC->language();
66 $this->access = $DIC->access();
67 $this->help = $DIC[
"ilHelp"];
68 $this->obj_data_cache = $DIC[
"ilObjDataCache"];
69 $this->ref_id = $a_parent_obj->ref_id;
70 $this->schedule_id = (int) $_REQUEST[
'schedule_id'];
82 $next_class =
$ilCtrl->getNextClass($this);
84 switch ($next_class) {
86 $cmd =
$ilCtrl->getCmd(
"render");
105 include_once
'Modules/BookingManager/classes/class.ilBookingSchedulesTableGUI.php';
108 if ($ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
110 if (
sizeof(
$table->getData())) {
111 include_once
"Modules/BookingManager/classes/class.ilBookingObject.php";
117 include_once
'Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
120 $bar = $bar->getHTML();
137 $ilTabs->clearTargets();
138 $ilTabs->setBackTarget(
$lng->txt(
'book_back_to_list'),
$ilCtrl->getLinkTarget($this,
'render'));
139 $ilHelp->setScreenIdComponent(
"book");
140 $ilHelp->setScreenId(
"schedules");
141 $ilHelp->setSubScreenId(
"create");
158 $ilTabs->clearTargets();
159 $ilTabs->setBackTarget(
$lng->txt(
'book_back_to_list'),
$ilCtrl->getLinkTarget($this,
'render'));
160 $ilHelp->setScreenIdComponent(
"book");
161 $ilHelp->setScreenId(
"schedules");
162 $ilHelp->setSubScreenId(
"edit");
179 $lng->loadLanguageModule(
"dateplaner");
181 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
186 $title->setRequired(
true);
188 $title->setMaxLength(120);
189 $form_gui->addItem(
$title);
191 include_once
"Modules/BookingManager/classes/class.ilScheduleInputGUI.php";
193 $definition->
setInfo(
$lng->txt(
"book_schedule_days_info"));
194 $definition->setRequired(
true);
195 $form_gui->addItem($definition);
199 $form_gui->addItem($deadline_opts);
202 $deadline_opts->addOption($deadline_time);
205 $deadline->
setInfo(
$lng->txt(
"book_deadline_info"));
206 $deadline->setSuffix(
$lng->txt(
"book_hours"));
207 $deadline->setMinValue(1);
208 $deadline->setSize(3);
209 $deadline->setMaxLength(3);
210 $deadline_time->addSubItem($deadline);
212 $deadline_start =
new ilRadioOption(
$lng->txt(
"book_deadline_slot_start"),
"slot_start");
213 $deadline_opts->addOption($deadline_start);
215 $deadline_slot =
new ilRadioOption(
$lng->txt(
"book_deadline_slot_end"),
"slot_end");
216 $deadline_opts->addOption($deadline_slot);
218 if ($a_mode ==
"edit") {
219 include_once
'Modules/BookingManager/classes/class.ilBookingSchedule.php';
224 $av->setTitle(
$lng->txt(
"obj_activation_list_gui"));
225 $form_gui->addItem($av);
228 $lng->loadLanguageModule(
'rep');
231 $from->setShowTime(
true);
232 $form_gui->addItem(
$from);
236 $form_gui->addItem($to);
238 if ($a_mode ==
"edit") {
239 $form_gui->setTitle(
$lng->txt(
"book_edit_schedule"));
242 $item->setValue(
$id);
243 $form_gui->addItem($item);
245 include_once
'Modules/BookingManager/classes/class.ilBookingSchedule.php';
247 $title->setValue($schedule->getTitle());
248 $from->setDate($schedule->getAvailabilityFrom());
249 $to->setDate($schedule->getAvailabilityTo());
251 if ($schedule->getDeadline() == 0) {
252 $deadline_opts->setValue(
"slot_start");
253 } elseif ($schedule->getDeadline() > 0) {
254 $deadline->setValue($schedule->getDeadline());
255 $deadline_opts->setValue(
"hours");
257 $deadline->setValue(0);
258 $deadline_opts->setValue(
"slot_end");
276 $definition->setValue($schedule->getDefinitionBySlots());
278 $form_gui->addCommandButton(
"update",
$lng->txt(
"save"));
280 $form_gui->setTitle(
$lng->txt(
"book_add_schedule"));
281 $form_gui->addCommandButton(
"save",
$lng->txt(
"save"));
282 $form_gui->addCommandButton(
"render",
$lng->txt(
"cancel"));
284 $form_gui->setFormAction(
$ilCtrl->getFormAction($this));
298 if (
$form->checkInput()) {
299 include_once
'Modules/BookingManager/classes/class.ilBookingSchedule.php';
304 ilUtil::sendSuccess(
$lng->txt(
"book_schedule_added"));
307 $form->setValuesByPost();
322 if (
$form->checkInput()) {
323 include_once
'Modules/BookingManager/classes/class.ilBookingSchedule.php';
328 ilUtil::sendSuccess(
$lng->txt(
"book_schedule_updated"));
331 $form->setValuesByPost();
347 foreach ($days_group->getOptions() as $option) {
348 $days_fields[$option->getValue()] = $option;
351 foreach ($days as $day) {
352 $slot = $form->
getInput($day .
"_slot");
353 $subs = $days_fields[$day]->getSubItems();
355 $subs[0]->setValue($slot[0]);
358 $subs[1]->setValue($slot[1]);
373 $schedule->setTitle(
$form->getInput(
"title"));
374 $schedule->setPoolId($ilObjDataCache->lookupObjId($this->ref_id));
377 $schedule->setAvailabilityFrom(
$from->getDate());
379 $to =
$form->getItemByPostVar(
"to");
380 $schedule->setAvailabilityTo($to->getDate());
382 switch (
$form->getInput(
"deadline_opts")) {
384 $schedule->setDeadline(0);
388 $schedule->setDeadline(
$form->getInput(
"deadline"));
392 $schedule->setDeadline(-1);
427 $ilHelp->setSubScreenId(
"delete");
430 include_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
432 $conf->setFormAction(
$ilCtrl->getFormAction($this));
433 $conf->setHeaderText(
$lng->txt(
'book_confirm_delete'));
435 include_once
'Modules/BookingManager/classes/class.ilBookingSchedule.php';
437 $conf->addItem(
'schedule_id', $this->schedule_id,
$type->getTitle());
438 $conf->setConfirm(
$lng->txt(
'delete'),
'delete');
439 $conf->setCancel(
$lng->txt(
'cancel'),
'render');
441 $tpl->setContent($conf->getHTML());
447 public function delete()
452 include_once
'Modules/BookingManager/classes/class.ilBookingSchedule.php';
456 ilUtil::sendSuccess(
$lng->txt(
'book_schedule_deleted'),
true);
457 $ilCtrl->redirect($this,
'render');
This class represents an option in a radio group.
static getList($a_pool_id, $a_title=null)
Get list of booking objects for given type.
__construct($a_parent_obj)
Constructor.
schedule for booking ressource
if(!array_key_exists('StateId', $_REQUEST)) $id
List booking schedules (for booking pool)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if(isset($_POST['submit'])) $form
static _lookupObjId($a_id)
This class represents a text property in a property form.
initForm($a_mode="create", $id=null)
Build property form.
create()
Render creation form.
save()
Create new dataset.
executeCommand()
main switch
formToObject($form, $schedule)
Convert incoming form data to schedule object.
Class ilBookingScheduleGUI.
render()
Render list of booking schedules.
setDefinitionFromPost(ilPropertyFormGUI $form)
Reload definition values from post data.
confirmDelete()
Confirm delete.
if(empty($password)) $table
Confirmation screen class.