54 $this->lng->loadLanguageModule(
'crs');
56 $this->tabs_gui =& $ilTabs;
60 $this->item_id = $a_item_id;
61 $this->ctrl->saveParameter($this,
'item_id');
72 $cmd = $this->ctrl->getCmd();
78 $this->ctrl->returnToParent($this);
81 switch($this->ctrl->getNextClass($this))
84 case 'ilconditionhandlerinterface':
87 include_once
'./classes/class.ilConditionHandlerInterface.php';
88 $this->ctrl->saveParameter($this,
'item_id',
$_GET[
'item_id']);
90 $this->ctrl->forwardCommand($new_gui);
91 $this->tabs_gui->setTabActive(
'preconditions');
95 $this->tabs_gui->setTabActive(
'timings');
101 $this->tabs_gui->setTabActive(
'timings');
108 return $this->item_id;
113 $this->ctrl->returnToParent($this);
126 if(!$ilAccess->checkAccess(
'write',
'',$this->container_obj->getRefId()))
128 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->MESSAGE);
134 $tpl->setContent($this->form->getHTML());
145 $item_data = $this->items_obj->getItem($this->
getItemId());
147 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
149 $this->form->setFormAction($this->ctrl->getFormAction($this));
152 $this->form->setTitle(
$title.
': '.$this->lng->txt(
'crs_edit_timings'));
159 $dea->
setInfo($this->lng->txt(
'crs_timings_disabled_info'));
160 $timings->addOption($dea);
164 #$vis->setInfo($this->lng->txt('crs_timings_visibility'));
167 $start->setShowTime(
true);
168 #$start->setMinuteStepSize(5);
173 #$end->setMinuteStepSize(5);
174 $vis->addSubItem($end);
176 $isv =
new ilCheckboxInputGUI($this->lng->txt(
'crs_timings_visibility_short'),
'visible');
177 $isv->
setInfo($this->lng->txt(
'crs_timings_visibility'));
179 $vis->addSubItem($isv);
181 $timings->addOption($vis);
185 $tim->
setInfo($this->lng->txt(
'crs_item_presetting_info'));
187 $start =
new ilDateTimeInputGUI($this->lng->txt(
'crs_timings_sug_begin'),
'sug_start');
193 $cha =
new ilCheckboxInputGUI($this->lng->txt(
'crs_timings_changeable'),
'changeable');
196 $start =
new ilDateTimeInputGUI($this->lng->txt(
'crs_timings_early_begin'),
'early_start');
199 $late =
new ilDateTimeInputGUI($this->lng->txt(
'crs_timings_short_limit_start_end'),
'late_end');
203 $timings->addOption($tim);
205 $this->form->addItem($timings);
207 $this->form->addCommandButton(
'update',$this->lng->txt(
'save'));
208 $this->form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
221 $item_data = $this->items_obj->getItem($this->
getItemId());
223 $data[
'timing_type'] = $item_data[
'timing_type'];
224 $data[
'visible'] = $item_data[
'visible'];
225 $data[
'changeable'] = $item_data[
'changeable'];
247 $this->form->setValuesByArray(
$data);
258 global
$ilErr,$ilAccess,$ilObjDataCache,
$tpl,$ilUser;
260 if(!$ilAccess->checkAccess(
'write',
'',$this->container_obj->getRefId()))
262 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->MESSAGE);
265 if($this->form->checkInput())
267 $this->items_obj->setTimingType($this->form->getInput(
'timing_type'));
269 $date = $this->form->getInput(
'timing_start');
271 $this->items_obj->setTimingStart($date->get(
IL_CAL_UNIX));
273 $date = $this->form->getInput(
'timing_end');
275 $this->items_obj->setTimingEnd($date->get(
IL_CAL_UNIX));
277 $date = $this->form->getInput(
'sug_start');
279 $this->items_obj->setSuggestionStart($date->get(
IL_CAL_UNIX));
281 $date = $this->form->getInput(
'sug_end');
283 $this->items_obj->setSuggestionEnd($date->get(
IL_CAL_UNIX));
285 $date = $this->form->getInput(
'early_start');
287 $this->items_obj->setEarliestStart($date->get(
IL_CAL_UNIX));
289 $date = $this->form->getInput(
'late_end');
291 $this->items_obj->setLatestEnd($date->get(
IL_CAL_UNIX));
293 $this->items_obj->toggleVisible((
bool) $this->form->getInput(
'visible'));
294 $this->items_obj->toggleChangeable((
bool) $this->form->getInput(
'changeable'));
296 if(!$this->items_obj->validateActivation())
299 $this->form->setValuesByPost();
300 $tpl->setContent($this->form->getHTML());
305 $this->items_obj->update($this->
getItemId());
312 $this->form->setValuesByPost();
313 $tpl->setContent($this->form->getHTML());
322 global
$ilErr,$ilAccess,$ilObjDataCache;
324 if(!$ilAccess->checkAccess(
'write',
'',$this->container_obj->getRefId()))
326 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->MESSAGE);
329 $this->items_obj->moveUp((
int) $this->
getItemId());
332 $this->ctrl->returnToParent($this);
338 global
$ilErr,$ilAccess,$ilObjDataCache;
340 if(!$ilAccess->checkAccess(
'write',
'',$this->container_obj->getRefId()))
342 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->MESSAGE);
345 $this->items_obj->moveDown((
int) $this->
getItemId());
348 $this->ctrl->returnToParent($this);
362 if(!$tree->checkForParentType($this->getItemId(),
'crs'))
371 global $ilObjDataCache,
$tree;
373 include_once
"./Modules/Course/classes/class.ilCourseItems.php";
375 if(!is_object($this->items_obj))
377 $parent_ref = $tree->getParentId($this->item_id);
380 if($cont_obj->getType() ==
'crs')
382 $this->items_obj =&
new ilCourseItems($cont_obj,$cont_obj->getRefId());
387 $crs_ref_id = $tree->checkForParentType($cont_obj->getRefId(),
'crs');
390 $this->items_obj =&
new ilCourseItems($crs_obj,$cont_obj->getRefId());
412 global $rbacsystem,$ilUser;
414 $this->tabs_gui->clearTargets();
416 $this->tabs_gui->setBackTarget($this->lng->txt(
'back_to_'.$this->container_obj->getType().
'_content'),
417 'repository.php?ref_id='.$this->container_obj->getRefId());
418 $this->tabs_gui->addTarget(
"timings",
419 $this->ctrl->getLinkTarget($this,
'edit'),
420 "edit", get_class($this));
421 $this->ctrl->setParameterByClass(
'ilconditionhandlerinterface',
'item_id',(
int)
$_GET[
'item_id']);
422 $this->tabs_gui->addTarget(
"preconditions",
423 $this->ctrl->getLinkTargetByClass(
'ilConditionHandlerInterface',
'listConditions'),
424 "",
"ilConditionHandlerInterface");