87 $this->tpl = $DIC->ui()->mainTemplate();
88 $this->ctrl = $DIC->ctrl();
89 $this->lng = $DIC->language();
90 $this->lng->loadLanguageModule(
'crs');
92 $this->error = $DIC[
'ilErr'];
93 $this->tabs_gui = $DIC->tabs();
94 $this->access = $DIC->access();
95 $this->tree = $DIC->repositoryTree();
96 $this->
user = $DIC->user();
97 $this->help = $DIC[
"ilHelp"];
100 $this->parent_ref_id = $a_ref_id;
101 $this->item_id = $a_item_id;
103 $this->ctrl->saveParameter($this,
'item_id');
116 $cmd = $this->ctrl->getCmd();
119 if (!$this->item_id) {
121 $this->ctrl->returnToParent($this);
124 $tpl->getStandardTemplate();
126 switch ($this->ctrl->getNextClass($this)) {
127 case 'ilconditionhandlergui':
129 $this->ctrl->saveParameter($this,
'item_id',
$_GET[
'item_id']);
131 $this->ctrl->forwardCommand($new_gui);
132 $this->tabs_gui->setTabActive(
'preconditions');
138 $this->tabs_gui->setTabActive(
'timings');
143 $this->tabs_gui->setTabActive(
'timings');
187 $this->ctrl->setParameterByClass(
'ilrepositorygui',
'ref_id', $this->parent_ref_id);
188 $this->ctrl->redirectByClass(
'ilrepositorygui');
205 !$ilAccess->checkAccess(
'write',
'', $this->parent_ref_id) &&
206 !$ilAccess->checkAccess(
'write',
'', $this->
getItemId())) {
207 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->MESSAGE);
234 $form->setFormAction($this->ctrl->getFormAction($this));
237 $form->setTitle(
$title .
': ' . $this->lng->txt(
'crs_edit_timings'));
240 $availability =
new ilCheckboxInputGUI($this->lng->txt(
'crs_timings_availability_enabled'),
'availability');
246 $start->setShowTime(
true);
247 $availability->addSubItem(
$start);
251 $end->setShowTime(
true);
252 $availability->addSubItem(
$end);
254 $isv =
new ilCheckboxInputGUI($this->lng->txt(
'crs_timings_visibility_short'),
'visible');
255 $isv->
setInfo($this->lng->txt(
'crs_timings_visibility'));
257 $isv->setChecked((
bool) $this->
getActivation()->enabledVisible());
258 $availability->addSubItem($isv);
261 $form->addItem($availability);
263 $form->addCommandButton(
'update', $this->lng->txt(
'save'));
264 $form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
284 !$ilAccess->checkAccess(
'write',
'', $this->parent_ref_id) &&
285 !$ilAccess->checkAccess(
'write',
'', $this->
getItemId())) {
286 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->MESSAGE);
290 if (
$form->checkInput()) {
295 if (
$form->getInput(
'availability')) {
298 $timing_start =
$form->getItemByPostVar(
'timing_start')->getDate();
299 $timing_end =
$form->getItemByPostVar(
'timing_end')->getDate();
302 $form->getItemByPostVar(
'timing_start')->setAlert($this->lng->txt(
'crs_timing_err_start_end'));
303 $form->getItemByPostVar(
'timing_end')->setAlert($this->lng->txt(
'crs_timing_err_start_end'));
317 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'),
true);
318 $this->ctrl->redirect($this,
"edit");
324 $form->setValuesByPost();
336 $this->tabs_gui->clearTargets();
338 $ilHelp->setScreenIdComponent(
"obj");
340 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $this->parent_ref_id);
341 $back_link =
$ilCtrl->getLinkTargetByClass(
"ilrepositorygui",
"");
342 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$_GET[
"ref_id"]);
343 $this->tabs_gui->setBackTarget($this->lng->txt(
'btn_back'), $back_link);
345 $this->tabs_gui->addTarget(
347 $this->ctrl->getLinkTarget($this,
'edit'),
352 $this->ctrl->setParameterByClass(
'ilconditionhandlergui',
'item_id', $this->item_id);
353 $this->tabs_gui->addTarget(
355 $this->ctrl->getLinkTargetByClass(
'ilConditionHandlerGUI',
'listConditions'),
357 "ilConditionHandlerGUI" 368 $crs_ref_id =
$GLOBALS[
'tree']->checkForParentType(
369 $this->parent_ref_id,
class ilConditionHandlerGUI
const IL_CRS_VIEW_TIMING_ABSOLUTE
static _after(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
__construct($a_ref_id, $a_item_id)
ilObjectActivationGUI constructor.
getActivation()
Get item object.
const TIMINGS_DEACTIVATED
getParentId()
Get parent ref_id.
static _lookupTitle($a_id)
lookup object title
static lookupTimingMode($a_obj_id)
Class ilObjectActivationGUI.
cancel()
cancel action handler
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
executeCommand()
Execute command.
if(isset($_POST['submit'])) $form
static _lookupObjId($a_id)
initTimingMode()
Init type of timing mode.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
initFormEdit()
init form edit
Class ilObjectActivation.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
edit(ilPropertyFormGUI $form=null)
edit timings