4 require_once
"./classes/class.ilObjectGUI.php";
23 $this->ref_id = $a_parent_obj->ref_id;
33 $next_class = $ilCtrl->getNextClass($this);
38 $cmd = $ilCtrl->getCmd(
"render");
54 $ilTabs->clearTargets();
55 $ilTabs->setBackTarget($lng->txt(
'book_back_to_list'), $ilCtrl->getLinkTargetByClass(
'ilBookingTypeGUI',
'render'));
57 $ilCtrl->setParameter($this,
'type_id', (
int)
$_GET[
'type_id']);
59 if ($ilAccess->checkAccess(
'write',
'', $this->ref_id))
61 include_once
'Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
63 $bar->
addButton($lng->txt(
'book_add_object'), $ilCtrl->getLinkTarget($this,
'create'));
64 $bar = $bar->getHTML();
67 include_once
'Modules/BookingManager/classes/class.ilBookingObjectsTableGUI.php';
69 $tpl->setContent($bar.$table->getHTML());
79 $ilCtrl->setParameter($this,
'type_id', (
int)
$_REQUEST[
'type_id']);
81 $ilTabs->clearTargets();
82 $ilTabs->setBackTarget($lng->txt(
'book_back_to_list'), $ilCtrl->getLinkTarget($this,
'render'));
85 $tpl->setContent($form->getHTML());
95 $ilCtrl->setParameter($this,
'type_id', (
int)
$_REQUEST[
'type_id']);
97 $ilTabs->clearTargets();
98 $ilTabs->setBackTarget($lng->txt(
'book_back_to_list'), $ilCtrl->getLinkTarget($this,
'render'));
101 $tpl->setContent($form->getHTML());
114 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
119 $title->setRequired(
true);
121 $title->setMaxLength(120);
122 $form_gui->addItem(
$title);
124 include_once
'Modules/BookingManager/classes/class.ilBookingType.php';
126 if(!
$type->getScheduleId())
129 include_once
'Modules/BookingManager/classes/class.ilBookingSchedule.php';
132 $options[$schedule[
"booking_schedule_id"]] = $schedule[
"title"];
137 $schedule->setOptions($options);
138 $form_gui->addItem($schedule);
141 if ($a_mode ==
"edit")
143 $form_gui->setTitle($lng->txt(
"book_edit_object"));
146 $item->setValue($id);
147 $form_gui->addItem($item);
149 include_once
'Modules/BookingManager/classes/class.ilBookingObject.php';
155 $schedule->setValue(
$type->getScheduleId());
158 $form_gui->addCommandButton(
"update", $lng->txt(
"save"));
162 $form_gui->setTitle($lng->txt(
"book_add_object"));
163 $form_gui->addCommandButton(
"save", $lng->txt(
"save"));
164 $form_gui->addCommandButton(
"render", $lng->txt(
"cancel"));
166 $form_gui->setFormAction($ilCtrl->getFormAction($this));
179 if($form->checkInput())
181 include_once
'Modules/BookingManager/classes/class.ilBookingObject.php';
183 $obj->
setTitle($form->getInput(
"title"));
184 $obj->setTypeId((
int)
$_REQUEST[
"type_id"]);
185 $obj->setScheduleId($form->getInput(
"schedule"));
193 $ilCtrl->setParameter($this,
'type_id', (
int)
$_REQUEST[
'type_id']);
195 $ilTabs->clearTargets();
196 $ilTabs->setBackTarget($lng->txt(
'book_back_to_list'), $ilCtrl->getLinkTarget($this,
'render'));
198 $form->setValuesByPost();
199 $tpl->setContent($form->getHTML());
211 if($form->checkInput())
213 include_once
'Modules/BookingManager/classes/class.ilBookingObject.php';
215 $obj->setTitle($form->getInput(
"title"));
216 $obj->setTypeId((
int)
$_REQUEST[
'type_id']);
217 $obj->setScheduleId($form->getInput(
"schedule"));
225 $form->setValuesByPost();
226 $tpl->setContent($form->getHTML());
237 $ilCtrl->setParameter($this,
'type_id', (
int)
$_REQUEST[
'type_id']);
239 $ilTabs->clearTargets();
240 $ilTabs->setBackTarget($lng->txt(
'book_back_to_list'), $ilCtrl->getLinkTarget($this,
'render'));
242 include_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
244 $conf->setFormAction($ilCtrl->getFormAction($this));
245 $conf->setHeaderText($lng->txt(
'book_confirm_delete'));
247 include_once
'Modules/BookingManager/classes/class.ilBookingObject.php';
249 $conf->addItem(
'object_id', (
int)$_GET[
'object_id'],
$type->getTitle());
250 $conf->setConfirm($lng->txt(
'delete'),
'delete');
251 $conf->setCancel($lng->txt(
'cancel'),
'render');
253 $tpl->setContent($conf->getHTML());
263 $ilCtrl->setParameter($this,
'type_id', (
int)
$_REQUEST[
'type_id']);
265 include_once
'Modules/BookingManager/classes/class.ilBookingObject.php';
270 $ilCtrl->redirect($this,
'render');