58        $this->tpl = 
$DIC[
"tpl"];
 
   59        $this->ctrl = 
$DIC->ctrl();
 
   60        $this->lng = 
$DIC->language();
 
   61        $this->
error = $DIC[
"ilErr"];
 
   62        $this->tabs = 
$DIC->tabs();
 
   63        $this->access = 
$DIC->access();
 
   64        $this->tree = 
$DIC->repositoryTree();
 
   65        $this->
user = $DIC->user();
 
   66        $this->help = 
$DIC[
"ilHelp"];
 
   71        $ilTabs = 
$DIC->tabs();
 
   76        $this->lng->loadLanguageModule(
'crs');
 
   78        $this->tabs_gui =&$ilTabs;
 
   80        $this->parent_ref_id = $a_ref_id;
 
   81        $this->item_id = $a_item_id;
 
   82        $this->ctrl->saveParameter($this, 
'item_id');
 
   91        $cmd = $this->ctrl->getCmd();
 
   94        if (!$this->item_id) {
 
   96            $this->ctrl->returnToParent($this);
 
   99        $tpl->getStandardTemplate();
 
  101        switch ($this->ctrl->getNextClass($this)) {
 
  102            case 'ilconditionhandlergui':
 
  104                include_once 
'./Services/AccessControl/classes/class.ilConditionHandlerGUI.php';
 
  105                $this->ctrl->saveParameter($this, 
'item_id', 
$_GET[
'item_id']);
 
  107                $this->ctrl->forwardCommand($new_gui);
 
  108                $this->tabs_gui->setTabActive(
'preconditions');
 
  112                $this->tabs_gui->setTabActive(
'timings');
 
  117                $this->tabs_gui->setTabActive(
'timings');
 
  131        $this->ctrl->setParameterByClass(
'ilrepositorygui', 
'ref_id', $this->parent_ref_id);
 
  132        $this->ctrl->redirectByClass(
'ilrepositorygui');
 
  148        if (!$ilAccess->checkAccess(
'write', 
'', $this->parent_ref_id) &&
 
  149            !$ilAccess->checkAccess(
'write', 
'', $this->getItemId())) {
 
  150            $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->MESSAGE);
 
  156        $tpl->setContent($this->form->getHTML());
 
  169        include_once 
"Services/Object/classes/class.ilObjectActivation.php";
 
  171        include_once(
'./Services/Form/classes/class.ilPropertyFormGUI.php');
 
  173        $this->form->setFormAction($this->ctrl->getFormAction($this));
 
  176        $this->form->setTitle(
$title . 
': ' . $this->lng->txt(
'crs_edit_timings'));
 
  182        $dea->setInfo($this->lng->txt(
'crs_timings_disabled_info'));
 
  183        $timings->addOption($dea);
 
  187        #$vis->setInfo($this->lng->txt('crs_timings_visibility')); 
  189        $start = 
new ilDateTimeInputGUI($this->lng->txt(
'crs_timings_start'), 
'timing_start');
 
  190        $start->setRequired(
true);
 
  191        $start->setShowTime(
true);
 
  192        $vis->addSubItem($start);
 
  195        $end->setRequired(
true);
 
  196        $end->setShowTime(
true);
 
  197        $vis->addSubItem(
$end);
 
  199        $isv = 
new ilCheckboxInputGUI($this->lng->txt(
'crs_timings_visibility_short'), 
'visible');
 
  200        $isv->setInfo($this->lng->txt(
'crs_timings_visibility'));
 
  202        $vis->addSubItem($isv);
 
  204        $timings->addOption($vis);
 
  208        $tim->setInfo($this->lng->txt(
'crs_item_presetting_info'));
 
  210        $start = 
new ilDateTimeInputGUI($this->lng->txt(
'crs_timings_sug_begin'), 
'sug_start');
 
  211        $start->setRequired(
true);
 
  212        $tim->addSubItem($start);
 
  215        $end->setRequired(
true);
 
  216        $tim->addSubItem(
$end);
 
  218        if (
$tree->checkForParentType($this->parent_ref_id, 
'crs')) {
 
  219            $cha = 
new ilCheckboxInputGUI($this->lng->txt(
'crs_timings_changeable'), 
'changeable');
 
  220            $tim->addSubItem($cha);
 
  222            $start = 
new ilDateTimeInputGUI($this->lng->txt(
'crs_timings_early_begin'), 
'early_start');
 
  223            $start->setRequired(
true);
 
  224            $tim->addSubItem($start);
 
  226            $late = 
new ilDateTimeInputGUI($this->lng->txt(
'crs_timings_short_limit_start_end'), 
'late_end');
 
  227            $late->setRequired(
true);
 
  228            $tim->addSubItem($late);
 
  232        $timings->addOption($tim);
 
  234        $this->form->addItem($timings);
 
  236        $this->form->addCommandButton(
'update', $this->lng->txt(
'save'));
 
  237        $this->form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
 
  250        include_once 
"Services/Object/classes/class.ilObjectActivation.php";
 
  258            $data[
'timing_type'] = $item_data[
'timing_type'];
 
  259            $data[
'visible'] = $item_data[
'visible'];
 
  260            $data[
'changeable'] = $item_data[
'changeable'];
 
  263                'timing_start' => 
'timing_start' 
  264                ,
'timing_end' => 
'timing_end' 
  265                ,
'sug_start' => 
'suggestion_start' 
  266                ,
'sug_end' => 
'suggestion_end' 
  267                ,
'early_start' => 
'earliest_start' 
  268                ,
'late_end' => 
'latest_end' 
  270            foreach ($map as $data_key => $item_key) {
 
  271                $data[$data_key] = 
null;
 
  274                if ($item_data[$item_key]) {
 
  280        $this->form->setValuesByArray(
$data);
 
  297        if (!$ilAccess->checkAccess(
'write', 
'', $this->parent_ref_id) &&
 
  298            !$ilAccess->checkAccess(
'write', 
'', $this->getItemId())) {
 
  299            $ilErr->raiseError($this->lng->txt(
'permission_denied'), 
$ilErr->MESSAGE);
 
  303        if ($this->form->checkInput()) {
 
  304            include_once 
"Services/Object/classes/class.ilObjectActivation.php";
 
  307            $activation->setTimingType($this->form->getInput(
'timing_type'));
 
  309            $date = $this->form->getItemByPostVar(
'timing_start')->getDate();
 
  310            $activation->setTimingStart($date ? $date->get(
IL_CAL_UNIX) : 
null);
 
  312            $date = $this->form->getItemByPostVar(
'timing_end')->getDate();
 
  313            $activation->setTimingEnd($date ? $date->get(
IL_CAL_UNIX) : 
null);
 
  315            $date = $this->form->getItemByPostVar(
'sug_start')->getDate();
 
  316            $activation->setSuggestionStart($date ? $date->get(
IL_CAL_UNIX) : 
null);
 
  318            $date = $this->form->getItemByPostVar(
'sug_end')->getDate();
 
  319            $activation->setSuggestionEnd($date ? $date->get(
IL_CAL_UNIX) : 
null);
 
  322            $item = $this->form->getItemByPostVar(
'early_start');
 
  324                $date = $item->getDate();
 
  326            $activation->setEarliestStart($date ? $date->get(
IL_CAL_UNIX) : 
null);
 
  329            $item = $this->form->getItemByPostVar(
'late_end');
 
  331                $date = $item->getDate();
 
  333            $activation->setLatestEnd($date ? $date->get(
IL_CAL_UNIX) : 
null);
 
  335            $activation->toggleVisible((
bool) $this->form->getInput(
'visible'));
 
  336            $activation->toggleChangeable((
bool) $this->form->getInput(
'changeable'));
 
  338            if (!$activation->validateActivation()) {
 
  340                $this->form->setValuesByPost();
 
  341                $tpl->setContent($this->form->getHTML());
 
  346                $this->ctrl->redirect($this, 
"edit");
 
  349            $this->form->setValuesByPost();
 
  350            $tpl->setContent($this->form->getHTML());
 
  359        $this->tabs_gui->clearTargets();
 
  361        $ilHelp->setScreenIdComponent(
"obj");
 
  363        $ilCtrl->setParameterByClass(
"ilrepositorygui", 
"ref_id", $this->parent_ref_id);
 
  364        $back_link = 
$ilCtrl->getLinkTargetByClass(
"ilrepositorygui", 
"");
 
  365        $ilCtrl->setParameterByClass(
"ilrepositorygui", 
"ref_id", 
$_GET[
"ref_id"]);
 
  366        $this->tabs_gui->setBackTarget($this->lng->txt(
'btn_back'), $back_link);
 
  368        $this->tabs_gui->addTarget(
 
  370            $this->ctrl->getLinkTarget($this, 
'edit'),
 
  375        $this->ctrl->setParameterByClass(
'ilconditionhandlergui', 
'item_id', $this->item_id);
 
  376        $this->tabs_gui->addTarget(
 
  378            $this->ctrl->getLinkTargetByClass(
'ilConditionHandlerGUI', 
'listConditions'),
 
  380            "ilConditionHandlerGUI" 
An exception for terminatinating execution or to throw for unit testing.
error($a_errmsg)
set error message @access public
class ilConditionHandlerGUI
@classDescription Date and time handling
Class ilObjectActivationGUI.
initFormEdit()
init form edit
__construct($a_ref_id, $a_item_id)
Constructor @access public.
Class ilObjectActivation.
const TIMINGS_DEACTIVATED
static getItem($a_ref_id)
Get item data.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
This class represents an option in a radio group.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.