31 $this->lng->loadLanguageModule(
'crs');
33 $this->tabs_gui =& $ilTabs;
35 $this->parent_ref_id = $a_ref_id;
36 $this->item_id = $a_item_id;
37 $this->ctrl->saveParameter($this,
'item_id');
47 $cmd = $this->ctrl->getCmd();
53 $this->ctrl->returnToParent($this);
56 $tpl->getStandardTemplate();
58 switch($this->ctrl->getNextClass($this))
60 case 'ilconditionhandlergui':
62 include_once
'./Services/AccessControl/classes/class.ilConditionHandlerGUI.php';
63 $this->ctrl->saveParameter($this,
'item_id',
$_GET[
'item_id']);
65 $this->ctrl->forwardCommand($new_gui);
66 $this->tabs_gui->setTabActive(
'preconditions');
70 $this->tabs_gui->setTabActive(
'timings');
76 $this->tabs_gui->setTabActive(
'timings');
90 $this->ctrl->setParameterByClass(
'ilrepositorygui',
'ref_id', $this->parent_ref_id);
91 $this->ctrl->redirectByClass(
'ilrepositorygui');
105 if(!$ilAccess->checkAccess(
'write',
'',$this->parent_ref_id) &&
106 !$ilAccess->checkAccess(
'write',
'',$this->
getItemId()))
108 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->MESSAGE);
114 $tpl->setContent($this->form->getHTML());
127 include_once
"Services/Object/classes/class.ilObjectActivation.php";
129 include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
131 $this->form->setFormAction($this->ctrl->getFormAction($this));
134 $this->form->setTitle(
$title.
': '.$this->lng->txt(
'crs_edit_timings'));
140 $dea->
setInfo($this->lng->txt(
'crs_timings_disabled_info'));
141 $timings->addOption($dea);
145 #$vis->setInfo($this->lng->txt('crs_timings_visibility')); 148 $start->setRequired(
true);
149 $start->setShowTime(
true);
154 $end->setShowTime(
true);
155 $vis->addSubItem($end);
157 $isv =
new ilCheckboxInputGUI($this->lng->txt(
'crs_timings_visibility_short'),
'visible');
158 $isv->
setInfo($this->lng->txt(
'crs_timings_visibility'));
160 $vis->addSubItem($isv);
162 $timings->addOption($vis);
166 $tim->
setInfo($this->lng->txt(
'crs_item_presetting_info'));
168 $start =
new ilDateTimeInputGUI($this->lng->txt(
'crs_timings_sug_begin'),
'sug_start');
169 $start->setRequired(
true);
174 $tim->addSubItem($end);
176 if ($tree->checkForParentType($this->parent_ref_id,
'crs'))
178 $cha =
new ilCheckboxInputGUI($this->lng->txt(
'crs_timings_changeable'),
'changeable');
181 $start =
new ilDateTimeInputGUI($this->lng->txt(
'crs_timings_early_begin'),
'early_start');
182 $start->setRequired(
true);
185 $late =
new ilDateTimeInputGUI($this->lng->txt(
'crs_timings_short_limit_start_end'),
'late_end');
187 $tim->addSubItem($late);
191 $timings->addOption($tim);
193 $this->form->addItem($timings);
195 $this->form->addCommandButton(
'update',$this->lng->txt(
'save'));
196 $this->form->addCommandButton(
'cancel',$this->lng->txt(
'cancel'));
209 include_once
"Services/Object/classes/class.ilObjectActivation.php";
220 $data[
'timing_type'] = $item_data[
'timing_type'];
221 $data[
'visible'] = $item_data[
'visible'];
222 $data[
'changeable'] = $item_data[
'changeable'];
225 'timing_start' =>
'timing_start' 226 ,
'timing_end' =>
'timing_end' 227 ,
'sug_start' =>
'suggestion_start' 228 ,
'sug_end' =>
'suggestion_end' 229 ,
'early_start' =>
'earliest_start' 230 ,
'late_end' =>
'latest_end' 232 foreach($map as $data_key => $item_key)
234 $data[$data_key] = null;
237 if($item_data[$item_key])
244 $this->form->setValuesByArray(
$data);
258 if(!$ilAccess->checkAccess(
'write',
'',$this->parent_ref_id) &&
259 !$ilAccess->checkAccess(
'write',
'',$this->
getItemId()))
261 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->MESSAGE);
265 if($this->form->checkInput())
267 include_once
"Services/Object/classes/class.ilObjectActivation.php";
270 $activation->setTimingType($this->form->getInput(
'timing_type'));
272 $date = $this->form->getItemByPostVar(
'timing_start')->getDate();
273 $activation->setTimingStart($date ? $date->get(
IL_CAL_UNIX) : null);
275 $date = $this->form->getItemByPostVar(
'timing_end')->getDate();
276 $activation->setTimingEnd($date ? $date->get(
IL_CAL_UNIX) : null);
278 $date = $this->form->getItemByPostVar(
'sug_start')->getDate();
279 $activation->setSuggestionStart($date ? $date->get(
IL_CAL_UNIX) : null);
281 $date = $this->form->getItemByPostVar(
'sug_end')->getDate();
282 $activation->setSuggestionEnd($date ? $date->get(
IL_CAL_UNIX) : null);
285 $item = $this->form->getItemByPostVar(
'early_start');
288 $date = $item->getDate();
290 $activation->setEarliestStart($date ? $date->get(
IL_CAL_UNIX) : null);
293 $item = $this->form->getItemByPostVar(
'late_end');
296 $date = $item->getDate();
298 $activation->setLatestEnd($date ? $date->get(
IL_CAL_UNIX) : null);
300 $activation->toggleVisible((
bool) $this->form->getInput(
'visible'));
301 $activation->toggleChangeable((
bool) $this->form->getInput(
'changeable'));
303 if(!$activation->validateActivation())
306 $this->form->setValuesByPost();
307 $tpl->setContent($this->form->getHTML());
314 $this->ctrl->redirect($this,
"edit");
319 $this->form->setValuesByPost();
320 $tpl->setContent($this->form->getHTML());
328 $this->tabs_gui->clearTargets();
330 $ilHelp->setScreenIdComponent(
"obj");
332 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->parent_ref_id);
333 $back_link = $ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"");
334 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
335 $this->tabs_gui->setBackTarget($this->lng->txt(
'btn_back'), $back_link);
337 $this->tabs_gui->addTarget(
"timings",
338 $this->ctrl->getLinkTarget($this,
'edit'),
339 "edit", get_class($this));
341 $this->ctrl->setParameterByClass(
'ilconditionhandlergui',
'item_id',$this->item_id);
342 $this->tabs_gui->addTarget(
"preconditions",
343 $this->ctrl->getLinkTargetByClass(
'ilConditionHandlerGUI',
'listConditions'),
344 "",
"ilConditionHandlerGUI");
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
This class represents an option in a radio group.
class ilConditionHandlerGUI
__construct($a_ref_id, $a_item_id)
Constructor public.
static getItem($a_ref_id)
Get item data.
const TIMINGS_DEACTIVATED
static _lookupTitle($a_id)
lookup object title
setInfo($a_info)
Set Info.
Class ilObjectActivationGUI.
addSubItem($a_item)
Add Subitem.
static _lookupObjId($a_id)
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
initFormEdit()
init form edit
Class ilObjectActivation.