19 declare(strict_types=0);
    58         $this->main_tpl = $DIC->ui()->mainTemplate();
    59         $this->tpl = $DIC->ui()->mainTemplate();
    60         $this->
ctrl = $DIC->ctrl();
    61         $this->
lng = $DIC->language();
    62         $this->
tabs = $DIC->tabs();
    64         $this->
access = $DIC->access();
    65         $this->error = $DIC[
'ilErr'];
    66         $this->
user = $DIC->user();
    68         $this->tree = $DIC->repositoryTree();
    69         $this->
http = $DIC->http();
    71         $this->ui_factory = $DIC->ui()->factory();
    72         $this->ui_renderer = $DIC->ui()->renderer();
    74         $this->container_gui = $container_gui_obj;
    75         $this->container_obj = $this->container_gui->
getObject();
    81         if (!$this->
access->checkAccess(
'read', 
'', $this->container_obj->getRefId())) {
    82             $this->error->raiseError($this->
lng->txt(
'msg_no_perm_read'), $this->error->WARNING);
    86         $this->
tabs->setTabActive(
'view_content');
    87         $cmd = $this->
ctrl->getCmd();
    89         switch ($this->
ctrl->getNextClass($this)) {
   106         if ($this->
http->wrapper()->query()->has(
'member_id')) {
   107             return $this->
http->wrapper()->query()->retrieve(
   122         if ($this->
access->checkAccess(
'write', 
'', $this->course_obj->getRefId())) {
   125         $start_obj = 
new ilCourseStart($this->course_obj->getRefId(), $this->course_obj->getId());
   126         if (count($start_obj->getStartObjects()) && !$start_obj->allFullfilled($this->user->getId())) {
   134         $this->
tabs->setSubTabActive(
'crs_content');
   136         $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.crs_start_view.html", 
'Modules/Course');
   137         $this->tpl->setVariable(
"INFO_STRING", $this->
lng->txt(
'crs_info_start'));
   138         $this->tpl->setVariable(
"TBL_TITLE_START", $this->
lng->txt(
'crs_table_start_objects'));
   139         $this->tpl->setVariable(
"HEADER_NR", $this->
lng->txt(
'crs_nr'));
   140         $this->tpl->setVariable(
"HEADER_DESC", $this->
lng->txt(
'description'));
   141         $this->tpl->setVariable(
"HEADER_EDITED", $this->
lng->txt(
'crs_objective_accomplished'));
   149             $ref_id = $start[
'item_ref_id'];
   158             $obj_frame = 
$type == 
'tst' ? 
'' : $obj_frame;
   161                 $this->tpl->setCurrentBlock(
"start_read");
   163                 $this->tpl->setVariable(
"READ_TARGET_START", $obj_frame);
   164                 $this->tpl->setVariable(
   166                     $obj_link . 
'&crs_show_result=' . $this->course_obj->getRefId()
   168                 $this->tpl->parseCurrentBlock();
   170                 $this->tpl->setCurrentBlock(
"start_visible");
   172                 $this->tpl->parseCurrentBlock();
   176             if (isset($continue_data[
$ref_id])) {
   177                 $this->tpl->setCurrentBlock(
"link");
   178                 $this->tpl->setVariable(
"LINK_HREF", ilLink::_getLink($ref_id, 
'', array(
'obj_id',
   179                                                                                          $continue_data[$ref_id][
'lm_page_id']
   181                 #$this->tpl->setVariable("CONTINUE_LINK_TARGET",$target);   182                 $this->tpl->setVariable(
"LINK_NAME", $this->
lng->txt(
'continue_work'));
   183                 $this->tpl->parseCurrentBlock();
   187             if ($this->course_obj->getAboStatus()) {
   188                 if (!$this->fav_manager->ifIsFavourite($this->user->getId(), 
$ref_id)) {
   189                     if ($this->
access->checkAccess(
'read', 
'', $ref_id)) {
   190                         $this->tpl->setCurrentBlock(
"link");
   191                         $this->
ctrl->setParameterByClass(get_class($this->container_gui), 
'item_ref_id', $ref_id);
   192                         $this->
ctrl->setParameterByClass(get_class($this->container_gui), 
'item_id', $ref_id);
   193                         $this->
ctrl->setParameterByClass(get_class($this->container_gui), 
'type', 
$type);
   195                         $this->tpl->setVariable(
   197                             $this->
ctrl->getLinkTarget($this->container_gui, 
'addToDesk')
   199                         $this->tpl->setVariable(
"LINK_NAME", $this->
lng->txt(
"rep_add_to_favourites"));
   200                         $this->tpl->parseCurrentBlock();
   203                     $this->tpl->setCurrentBlock(
"link");
   204                     $this->
ctrl->setParameterByClass(get_class($this->container_gui), 
'item_ref_id', $ref_id);
   205                     $this->
ctrl->setParameterByClass(get_class($this->container_gui), 
'item_id', $ref_id);
   206                     $this->
ctrl->setParameterByClass(get_class($this->container_gui), 
'type', 
$type);
   208                     $this->tpl->setVariable(
   210                         $this->
ctrl->getLinkTarget($this->container_gui, 
'removeFromDesk')
   212                     $this->tpl->setVariable(
"LINK_NAME", $this->
lng->txt(
"rep_remove_from_favourites"));
   213                     $this->tpl->parseCurrentBlock();
   219                 $this->tpl->setCurrentBlock(
"start_description");
   221                 $this->tpl->parseCurrentBlock();
   225                 $accomplished = 
'accomplished';
   228                 $accomplished = 
'not_accomplished';
   231             $this->tpl->setCurrentBlock(
"start_row");
   232             $this->tpl->setVariable(
"EDITED_IMG", $icon);
   233             $this->tpl->setVariable(
"EDITED_ALT", $this->
lng->txt(
'crs_objective_' . $accomplished));
   234             $this->tpl->setVariable(
"ROW_CLASS", 
'option_value');
   235             $this->tpl->setVariable(
"ROW_CLASS_CENTER", 
'option_value_center');
   236             $this->tpl->setVariable(
"OBJ_NR_START", ++$counter . 
'.');
   237             $this->tpl->parseCurrentBlock();
   246         if (!$this->
access->checkAccess(
'write', 
'', $this->container_obj->getRefId())) {
   247             $this->error->raiseError($this->
lng->txt(
'msg_no_perm_write'), $this->error->WARNING);
   249         $this->
tabs->setTabActive(
'timings_timings');
   250         $this->
tabs->clearSubTabs();
   258         if ($failed_items !== []) {
   259             $table->setFailureStatus(
true);
   266         $this->tpl->setContent($table->getHTML());
   276         if (!$this->
access->checkAccess(
'read', 
'', $this->container_obj->getRefId())) {
   277             $this->error->raiseError($this->
lng->txt(
'msg_no_perm_read'), $ilErr->WARNING);
   279         $this->
tabs->setTabActive(
'timings_timings');
   280         $this->
tabs->clearSubTabs();
   284             'managePersonalTimings',
   288         $table->setFailureStatus((
bool) count($failed));
   289         $table->setUserId($this->
user->getId());
   298         $this->tpl->setContent($table->getHTML());
   306         if (!$this->
access->checkAccess(
'read', 
'', $this->container_obj->getRefId())) {
   307             $this->error->raiseError($this->
lng->txt(
'msg_no_perm_write'), $this->error->WARNING);
   309         $this->
tabs->clearSubTabs();
   312         $post_item = (array) ($this->
http->request()->getParsedBody()[
'item']) ?? [];
   317             if ($sug_start_dt instanceof 
ilDate && $sug_end_dt instanceof 
ilDate) {
   319                     $failed[
$ref_id] = 
'crs_timing_err_start_end';
   328                 $failed[
'ref_id'] = 
'crs_timing_err_valid_dates';
   331         if ($failed === []) {
   332             $this->main_tpl->setOnScreenMessage(
'success', 
$GLOBALS[
'lng']->txt(
'settings_saved'));
   336             $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'));
   344         $this->
ctrl->returnToParent($this);
   353         $this->tpl->addBlockfile(
'ADM_CONTENT', 
'adm_content', 
'tpl.crs_user_timings.html', 
'Modules/Course');
   354         $this->
tabs->clearSubTabs();
   355         $this->
tabs->setTabActive(
'members');
   358             $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_checkbox'), 
true);
   359             $this->
ctrl->returnToParent($this);
   363         $this->tpl->addBlockfile(
"BUTTONS", 
"buttons", 
"tpl.buttons.html");
   364         $this->tpl->setCurrentBlock(
"btn_cell");
   365         $this->tpl->setVariable(
"BTN_LINK", $this->
ctrl->getLinkTarget($this, 
'returnToMembers'));
   366         $this->tpl->setVariable(
"BTN_TXT", $this->
lng->txt(
"back"));
   367         $this->tpl->parseCurrentBlock();
   369         $usr_icon = $this->ui_factory->symbol()->icon()->standard(
   371             $this->
lng->txt(
'obj_usr'),
   374         $this->tpl->setVariable(
"HEADER_IMG", $this->ui_renderer->render($usr_icon));
   375         $this->tpl->setVariable(
"TABLE_HEADER", $this->
lng->txt(
'timings_of'));
   377         $this->tpl->setVariable(
"USER_NAME", $name[
'lastname'] . 
', ' . $name[
'firstname']);
   379         $this->tpl->setVariable(
"TXT_TITLE", $this->
lng->txt(
'title'));
   380         $this->tpl->setVariable(
"TXT_START_END", $this->
lng->txt(
'crs_timings_short_start_end'));
   381         $this->tpl->setVariable(
"TXT_INFO_START_END", $this->
lng->txt(
'crs_timings_start_end_info'));
   382         $this->tpl->setVariable(
"TXT_CHANGED", $this->
lng->txt(
'crs_timings_changed'));
   383         $this->tpl->setVariable(
"TXT_OWN_PRESETTING", $this->
lng->txt(
'crs_timings_planed_start'));
   384         $this->tpl->setVariable(
"TXT_INFO_OWN_PRESETTING", $this->
lng->txt(
'crs_timings_from_until'));
   387         foreach ($items as $item) {
   401         $this->
lng->loadLanguageModule(
'meta');
   405         for ($i = 0; $i < $level; $i++) {
   406             $this->tpl->touchBlock(
'start_indent');
   407             $this->tpl->touchBlock(
'end_indent');
   409         if (strlen($item[
'description'])) {
   410             $this->tpl->setCurrentBlock(
"item_description");
   411             $this->tpl->setVariable(
"DESC", $item[
'description']);
   412             $this->tpl->parseCurrentBlock();
   415             $this->tpl->setCurrentBlock(
"tlt");
   416             $this->tpl->setVariable(
"TXT_TLT", $this->
lng->txt(
'meta_typical_learning_time'));
   418             $this->tpl->parseCurrentBlock();
   421         if (!$item[
'title'] &&
   422             $item[
'type'] == 
'sess') {
   427                 (
bool) $app_info[
'fullday']
   431         $this->tpl->setCurrentBlock(
"title_plain");
   432         $this->tpl->setVariable(
"TITLE", $item[
'title']);
   433         $this->tpl->parseCurrentBlock();
   435         $this->tpl->setCurrentBlock(
"container_standard_row");
   437         $this->tpl->setVariable(
'TYPE_IMG', 
ilObject::_getIcon($item[
'obj_id'], 
'tiny', $item[
'type']));
   438         $this->tpl->setVariable(
"TYPE_ALT_IMG", $this->
lng->txt(
'obj_' . $item[
'type']));
   442                 $this->tpl->setVariable(
'SUG_START', $usr_planed->getStart()->get(
IL_CAL_DATE));
   445                 $this->tpl->setVariable(
'SUG_END', $usr_planed->getEnd()->get(
IL_CAL_DATE));
   448         $this->tpl->parseCurrentBlock();
   459         if (!$this->
access->checkAccess(
'write', 
'', $this->container_obj->getRefId())) {
   460             $this->error->raiseError($this->
lng->txt(
'msg_no_perm_write'), $this->error->WARNING);
   463         $this->
tabs->clearSubTabs();
   466         $post_item = (array) ($this->
http->request()->getParsedBody()[
'item']) ?? [];
   473             $item_obj->toggleChangeable((
bool) (
$data[
'change'] ?? 
false));
   479                 if ($sug_start_dt instanceof 
ilDate && $sug_end_dt instanceof 
ilDate) {
   481                         $failed[
$ref_id] = 
'crs_timing_err_start_end';
   484                     $item_obj->setSuggestionStart($sug_start_dt->get(
IL_CAL_UNIX));
   485                     $item_obj->setSuggestionEnd($sug_end_dt->get(
IL_CAL_UNIX));
   487                     $failed[
'ref_id'] = 
'crs_timing_err_valid_dates';
   492                     (
int) 
$data[
'sug_start_rel'] < 0 || (
int) 
$data[
'duration_a'] < 0
   494                     $failed[
$ref_id] = 
'crs_timing_err_start_dur_rel';
   497                 $item_obj->setSuggestionStartRelative(
$data[
'sug_start_rel']);
   498                 $item_obj->setSuggestionEndRelative(
$data[
'sug_start_rel'] + 
$data[
'duration_a']);
   503                 $item_obj->setSuggestionStart($start->get(
IL_CAL_UNIX));
   506                 $item_obj->setSuggestionEnd($start->get(
IL_CAL_UNIX));
   511         if ($failed === []) {
   513             $this->course_obj->update();
   514             $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'));
   518             $this->main_tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'));
   526         if ($this->container_obj->getType() == 
'crs') {
   527             $this->container_gui->setContentSubTabs();
   536             $course_ref_id = $this->tree->checkForParentType($this->container_obj->getRefId(), 
'crs');
   538             if ($course instanceof ilObjCourse) {
   539                 $this->course_obj = $course;
 
Interface GlobalHttpState. 
 
manageTimings(array $failed_items=[])
Manage timings. 
 
updatePersonalTimings()
Update personal timings. 
 
const IL_CRS_VIEW_TIMING_ABSOLUTE
 
static hasChangeableTimings(int $ref_id)
Check if there is any active changeable timing (in subtree) 
 
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
ilContainerGUI $container_gui
 
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory) 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
const TIMINGS_DEACTIVATED
 
static _lookupName(int $a_user_id)
lookup user name 
 
__construct(ilContainerGUI $container_gui_obj)
 
Manages favourites, currently the interface for other components, needs discussion. 
 
static secondsToString(int $seconds, bool $force_with_seconds=false, ?ilLanguage $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ... 
 
ilFavouritesManager $fav_manager
 
__renderUserItem(array $item, int $level)
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static _lookupObjId(int $ref_id)
 
static getItems(int $parent_id, bool $with_list_data=true)
Get sub item data. 
 
showStartObjects(ilCourseStart $start_obj)
 
static _getTypicalLearningTimeSeconds(int $a_rbac_id, int $a_obj_id=0)
 
static getTimingsAdministrationItems(int $parent_id)
Get (sub) item data for timings administration view (active/inactive) 
 
isFullfilled(int $user_id, int $item_id)
 
static _lookupAppointment(int $a_obj_id)
 
static http()
Fetches the global http state from ILIAS. 
 
static _after(ilDateTime $start, ilDateTime $end, string $a_compare_field='', string $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets. 
 
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id 
 
ilGlobalTemplateInterface $tpl
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
TableGUI class for timings administration. 
 
managePersonalTimings(array $failed=[])
Manage personal timings. 
 
static _appointmentToString(int $start, int $end, bool $fulltime)
 
Error Handling & global info handling. 
 
static _checkAllConditionsOfTarget(int $a_target_ref_id, int $a_target_id, string $a_target_type="", int $a_usr_id=0)
checks wether all conditions of a target object are fulfilled 
 
Class ilCourseContentGUI. 
 
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder...
 
TableGUI class for editing personal timings. 
 
static parseIncomingDate($a_value, bool $a_add_time=false)
Try to parse incoming value to date object. 
 
ilObjectDataCache $objectDataCache
 
Class ilObjectActivation. 
 
ilContainer $container_obj
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
ilGlobalTemplateInterface $main_tpl