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");
126 $title->setRequired(
true);
128 $title->setMaxLength(120);
129 $form_gui->addItem(
$title);
131 include_once
"Modules/BookingManager/classes/class.ilScheduleInputGUI.php";
133 $definition->
setInfo($lng->txt(
"book_schedule_days_info"));
134 $definition->setRequired(
true);
135 $form_gui->addItem($definition);
139 $form_gui->addItem($deadline_opts);
141 $deadline_time =
new ilRadioOption($lng->txt(
"book_deadline_hours"),
"hours");
142 $deadline_opts->addOption($deadline_time);
145 $deadline->
setInfo($lng->txt(
"book_deadline_info"));
146 $deadline->setSuffix($lng->txt(
"book_hours"));
147 $deadline->setMinValue(1);
148 $deadline->setSize(3);
149 $deadline->setMaxLength(3);
150 $deadline_time->addSubItem($deadline);
152 $deadline_start =
new ilRadioOption($lng->txt(
"book_deadline_slot_start"),
"slot_start");
153 $deadline_opts->addOption($deadline_start);
155 $deadline_slot =
new ilRadioOption($lng->txt(
"book_deadline_slot_end"),
"slot_end");
156 $deadline_opts->addOption($deadline_slot);
158 if ($a_mode ==
"edit")
160 include_once
'Modules/BookingManager/classes/class.ilBookingSchedule.php';
165 $av->setTitle($lng->txt(
"obj_activation_list_gui"));
166 $form_gui->addItem($av);
169 $lng->loadLanguageModule(
'rep');
173 $form_gui->addItem($from);
177 $form_gui->addItem($to);
179 if ($a_mode ==
"edit")
181 $form_gui->setTitle($lng->txt(
"book_edit_schedule"));
184 $item->setValue($id);
185 $form_gui->addItem($item);
187 include_once
'Modules/BookingManager/classes/class.ilBookingSchedule.php';
189 $title->setValue($schedule->getTitle());
190 $from->setDate($schedule->getAvailabilityFrom());
191 $to->setDate($schedule->getAvailabilityTo());
193 if($schedule->getDeadline() == 0)
195 $deadline_opts->setValue(
"slot_start");
197 else if($schedule->getDeadline() > 0)
199 $deadline->setValue($schedule->getDeadline());
200 $deadline_opts->setValue(
"hours");
204 $deadline->setValue(0);
205 $deadline_opts->setValue(
"slot_end");
223 $definition->setValue($schedule->getDefinitionBySlots());
225 $form_gui->addCommandButton(
"update", $lng->txt(
"save"));
229 $form_gui->setTitle($lng->txt(
"book_add_schedule"));
230 $form_gui->addCommandButton(
"save", $lng->txt(
"save"));
231 $form_gui->addCommandButton(
"render", $lng->txt(
"cancel"));
233 $form_gui->setFormAction($ilCtrl->getFormAction($this));
246 if($form->checkInput())
248 include_once
'Modules/BookingManager/classes/class.ilBookingSchedule.php';
258 $form->setValuesByPost();
260 $tpl->setContent($form->getHTML());
272 if($form->checkInput())
274 include_once
'Modules/BookingManager/classes/class.ilBookingSchedule.php';
284 $form->setValuesByPost();
286 $tpl->setContent($form->getHTML());
301 foreach($days_group->getOptions() as $option)
303 $days_fields[$option->getValue()] = $option;
306 foreach($days as $day)
308 $slot = $form->
getInput($day.
"_slot");
309 $subs = $days_fields[$day]->getSubItems();
312 $subs[0]->setValue($slot[0]);
316 $subs[1]->setValue($slot[1]);
329 global $ilObjDataCache;
331 $schedule->setTitle($form->getInput(
"title"));
332 $schedule->setPoolId($ilObjDataCache->lookupObjId($this->ref_id));
334 $from = $form->getItemByPostVar(
"from");
335 $schedule->setAvailabilityFrom($from->getDate());
337 $to = $form->getItemByPostVar(
"to");
338 $schedule->setAvailabilityTo($to->getDate());
340 switch($form->getInput(
"deadline_opts"))
343 $schedule->setDeadline(0);
347 $schedule->setDeadline($form->getInput(
"deadline"));
351 $schedule->setDeadline(-1);
382 $ilHelp->setSubScreenId(
"delete");
385 include_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
387 $conf->setFormAction($ilCtrl->getFormAction($this));
388 $conf->setHeaderText($lng->txt(
'book_confirm_delete'));
390 include_once
'Modules/BookingManager/classes/class.ilBookingSchedule.php';
392 $conf->addItem(
'schedule_id', (
int)$_GET[
'schedule_id'], $type->getTitle());
393 $conf->setConfirm($lng->txt(
'delete'),
'delete');
394 $conf->setCancel($lng->txt(
'cancel'),
'render');
396 $tpl->setContent($conf->getHTML());
406 include_once
'Modules/BookingManager/classes/class.ilBookingSchedule.php';
411 $ilCtrl->redirect($this,
'render');
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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
List booking schedules (for booking pool)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
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.
Confirmation screen class.