38 $ilObjDataCache = $DIC[
'ilObjDataCache'];
39 $ilTabs = $DIC[
'ilTabs'];
44 $this->lng->loadLanguageModule(
'crs');
45 $this->tabs_gui = $ilTabs;
47 $this->container_gui = &$container_gui_obj;
48 $this->container_obj = &$this->container_gui->object;
57 $ilAccess = $DIC[
'ilAccess'];
59 $ilTabs = $DIC[
'ilTabs'];
62 if (!$ilAccess->checkAccess(
'read',
'', $this->container_obj->getRefId())) {
63 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),
$ilErr->WARNING);
68 $this->tabs_gui->setTabActive(
'view_content');
69 $cmd = $this->ctrl->getCmd();
71 switch ($this->ctrl->getNextClass($this)) {
72 case 'ilcoursearchivesgui':
73 $this->__forwardToArchivesGUI();
77 $ilCtrl->saveParameterByClass(
"ilcolumngui",
"col_return");
78 $ilTabs->setSubTabActive(
"crs_content");
89 if ((!$this->is_tutor
and 90 $this->container_obj->getType() ==
'crs' and 91 $this->container_obj->enabledObjectiveView()) ||
92 $_GET[
"col_return"] ==
"objectives") {
93 $this->use_objective_presentation =
true;
120 $ilAccess = $DIC[
'ilAccess'];
123 if (
$_SESSION[
'crs_timings_panel'][$this->course_obj->getId()]) {
124 return 'manageTimings';
126 if ($ilAccess->checkAccess(
'write',
'', $this->container_obj->getRefId())) {
129 if ($this->container_obj->getType() ==
'crs' and 131 return 'editUserTimings';
138 include_once
'./Modules/Course/classes/class.ilCourseStart.php';
142 $ilAccess = $DIC[
'ilAccess'];
145 if ($ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
148 $this->start_obj =
new ilCourseStart($this->course_obj->getRefId(), $this->course_obj->getId());
149 if (count($this->start_obj->getStartObjects())
and !$this->start_obj->allFullfilled(
$ilUser->getId())) {
157 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
158 include_once
'./Services/Repository/classes/class.ilRepositoryExplorer.php';
159 include_once
'./Services/Link/classes/class.ilLink.php';
163 $rbacsystem = $DIC[
'rbacsystem'];
164 $ilias = $DIC[
'ilias'];
166 $ilAccess = $DIC[
'ilAccess'];
167 $ilObjDataCache = $DIC[
'ilObjDataCache'];
169 $this->tabs_gui->setSubTabActive(
'crs_content');
171 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_start_view.html",
'Modules/Course');
172 $this->tpl->setVariable(
"INFO_STRING", $this->lng->txt(
'crs_info_start'));
173 $this->tpl->setVariable(
"TBL_TITLE_START", $this->lng->txt(
'crs_table_start_objects'));
174 $this->tpl->setVariable(
"HEADER_NR", $this->lng->txt(
'crs_nr'));
175 $this->tpl->setVariable(
"HEADER_DESC", $this->lng->txt(
'description'));
176 $this->tpl->setVariable(
"HEADER_EDITED", $this->lng->txt(
'crs_objective_accomplished'));
183 foreach ($this->start_obj->getStartObjects() as
$start) {
184 $obj_id = $ilObjDataCache->lookupObjId(
$start[
'item_ref_id']);
192 $obj_frame = $obj_frame ? $obj_frame :
'';
195 $obj_frame =
$type ==
'tst' ?
'' : $obj_frame;
199 if ($ilAccess->checkAccess(
'read',
'',
$ref_id)) {
200 $this->tpl->setCurrentBlock(
"start_read");
201 $this->tpl->setVariable(
"READ_TITLE_START", $ilObjDataCache->lookupTitle(
$obj_id));
202 $this->tpl->setVariable(
"READ_TARGET_START", $obj_frame);
203 $this->tpl->setVariable(
"READ_LINK_START", $obj_link .
'&crs_show_result=' . $this->course_obj->getRefId());
204 $this->tpl->parseCurrentBlock();
206 $this->tpl->setCurrentBlock(
"start_visible");
207 $this->tpl->setVariable(
"VISIBLE_LINK_START", $ilObjDataCache->lookupTitle(
$obj_id));
208 $this->tpl->parseCurrentBlock();
212 if (isset($continue_data[
$ref_id])) {
213 $this->tpl->setCurrentBlock(
"link");
214 $this->tpl->setVariable(
"LINK_HREF",
ilLink::_getLink($ref_id,
'', array(
'obj_id',
215 $continue_data[$ref_id][
'lm_page_id'])));
216 #$this->tpl->setVariable("CONTINUE_LINK_TARGET",$target); 217 $this->tpl->setVariable(
"LINK_NAME", $this->lng->txt(
'continue_work'));
218 $this->tpl->parseCurrentBlock();
223 $this->course_obj->getAboStatus()) {
224 if ($ilAccess->checkAccess(
'read',
'', $ref_id)) {
225 $this->tpl->setCurrentBlock(
"link");
226 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'item_ref_id', $ref_id);
227 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'item_id', $ref_id);
228 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'type',
$type);
230 $this->tpl->setVariable(
"LINK_HREF", $this->ctrl->getLinkTarget($this->container_gui,
'addToDesk'));
231 $this->tpl->setVariable(
"LINK_NAME", $this->lng->txt(
"to_desktop"));
232 $this->tpl->parseCurrentBlock();
234 } elseif ($this->course_obj->getAboStatus()) {
235 $this->tpl->setCurrentBlock(
"link");
236 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'item_ref_id', $ref_id);
237 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'item_id', $ref_id);
238 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'type',
$type);
240 $this->tpl->setVariable(
"LINK_HREF", $this->ctrl->getLinkTarget($this->container_gui,
'removeFromDesk'));
241 $this->tpl->setVariable(
"LINK_NAME", $this->lng->txt(
"unsubscribe"));
242 $this->tpl->parseCurrentBlock();
247 if (strlen($ilObjDataCache->lookupDescription(
$obj_id))) {
248 $this->tpl->setCurrentBlock(
"start_description");
249 $this->tpl->setVariable(
"DESCRIPTION_START", $ilObjDataCache->lookupDescription(
$obj_id));
250 $this->tpl->parseCurrentBlock();
255 $accomplished =
'accomplished';
258 $accomplished =
'not_accomplished';
261 $this->tpl->setCurrentBlock(
"start_row");
262 $this->tpl->setVariable(
"EDITED_IMG", $icon);
263 $this->tpl->setVariable(
"EDITED_ALT", $this->lng->txt(
'crs_objective_' . $accomplished));
264 $this->tpl->setVariable(
"ROW_CLASS",
'option_value');
265 $this->tpl->setVariable(
"ROW_CLASS_CENTER",
'option_value_center');
266 $this->tpl->setVariable(
"OBJ_NR_START", ++$counter .
'.');
267 $this->tpl->parseCurrentBlock();
278 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
284 $this->container_obj->getType(),
285 $this->container_obj->getRefId(),
293 if (!$this->no_right_column) {
308 $ilAccess = $DIC[
'ilAccess'];
310 $ilCtrl->saveParameterByClass(
"ilcolumngui",
"col_return");
315 include_once(
"Services/Block/classes/class.ilColumnGUI.php");
324 if (
$ilCtrl->getNextClass() ==
"ilcolumngui" &&
341 $ilAccess = $DIC[
'ilAccess'];
344 $column_gui->setRepositoryMode(
true);
345 $column_gui->setEnableEdit(
false);
346 $column_gui->setBlockProperty(
349 $lng->txt(
"crs_news")
352 include_once
"Services/Object/classes/class.ilObjectActivation.php";
353 $grouped_items = array();
355 $grouped_items[$item[
"type"]][] = $item;
358 $column_gui->setRepositoryItems($grouped_items);
359 if ($ilAccess->checkAccess(
"write",
"", $this->container_obj->getRefId())) {
360 $column_gui->setEnableEdit(
true);
364 if ($this->is_tutor &&
365 $this->container_gui->isActiveAdministrationPanel()) {
366 $column_gui->setEnableMovement(
true);
370 if ($this->is_tutor) {
371 $column_gui->setBlockProperty(
"news",
"settings",
true);
373 $column_gui->setBlockProperty(
"news",
"default_visibility_option",
true);
374 $column_gui->setBlockProperty(
"news",
"hide_news_block_option",
true);
377 if ($this->container_gui->isActiveAdministrationPanel()) {
378 $column_gui->setAdminCommands(
true);
391 $ilAccess = $DIC[
'ilAccess'];
393 include_once(
"Services/Block/classes/class.ilColumnGUI.php");
415 $this->getDefaultView();
434 $ilAccess = $DIC->access();
436 $mainTemplate = $DIC->ui()->mainTemplate();
438 if (!$ilAccess->checkAccess(
'write',
'', $this->container_obj->getRefId())) {
439 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),
$ilErr->WARNING);
441 $GLOBALS[
'DIC'][
'ilTabs']->setTabActive(
'timings_timings');
442 $GLOBALS[
'DIC'][
'ilTabs']->clearSubTabs();
450 if (count($failed_items)) {
451 $table->setFailureStatus(
true);
457 $mainTemplate->setContent(
$table->getHTML());
467 if (!$ilAccess->checkAccess(
'read',
'', $this->container_obj->getRefId())) {
468 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'), $ilErr->WARNING);
470 $GLOBALS[
'ilTabs']->setTabActive(
'timings_timings');
473 include_once
'./Modules/Course/classes/Timings/class.ilTimingsPersonalTableGUI.php';
476 'managePersonalTimings',
503 if (!$ilAccess->checkAccess(
'read',
'', $this->container_obj->getRefId())) {
504 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'), $ilErr->WARNING);
507 $this->tabs_gui->clearSubTabs();
510 include_once
'./Services/Calendar/classes/class.ilCalendarUtil.php';
515 if (($sug_start_dt instanceof
ilDate)
and ($sug_end_dt instanceof ilDate)) {
516 include_once
'./Services/Calendar/classes/class.ilDateTime.php';
522 include_once
'./Modules/Course/classes/Timings/class.ilTimingUser.php';
528 $failed[
'ref_id'] =
'crs_timing_err_valid_dates';
534 ilUtil::sendSuccess(
$GLOBALS[
'lng']->txt(
'settings_saved'));
555 $ilAccess = $DIC[
'ilAccess'];
558 $this->lng->loadLanguageModule(
'meta');
560 if (!$ilAccess->checkAccess(
'write',
'', $this->container_obj->getRefId())) {
561 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),
$ilErr->WARNING);
563 $this->tabs_gui->setTabActive(
'timings_timings');
564 $this->tabs_gui->clearSubTabs();
568 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_edit_items.html',
'Modules/Course');
569 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
571 $this->tpl->setVariable(
"HEADER_ALT", $this->lng->txt(
'crs_materials'));
572 $this->tpl->setVariable(
"BLOCK_HEADER_CONTENT", $this->lng->txt(
'edit_timings_list'));
573 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
'title'));
576 $this->tpl->setVariable(
"TXT_DURATION", $this->lng->txt(
'crs_timings_time_frame'));
577 $this->tpl->setVariable(
"TXT_INFO_DURATION", $this->lng->txt(
'crs_timings_in_days'));
579 $this->tpl->setVariable(
"TXT_START_END", $this->lng->txt(
'crs_timings_short_start_end'));
580 $this->tpl->setVariable(
"TXT_INFO_START_END", $this->lng->txt(
'crs_timings_start_end_info'));
582 $this->tpl->setVariable(
"TXT_CHANGEABLE", $this->lng->txt(
'crs_timings_short_changeable'));
584 $this->tpl->setVariable(
"TXT_INFO_LIMIT", $this->lng->txt(
'crs_timings_from_until'));
585 $this->tpl->setVariable(
"TXT_LIMIT", $this->lng->txt(
'crs_timings_short_limit_start_end'));
586 $this->tpl->setVariable(
"TXT_ACTIVE", $this->lng->txt(
'crs_timings_short_active'));
587 $this->tpl->setVariable(
"TXT_INFO_ACTIVE", $this->lng->txt(
'crs_timings_info_active'));
590 foreach ($this->cont_arr as $item) {
591 if ($item[
'type'] ==
'itgr') {
595 $item_prefix =
"item[$item[ref_id]]";
596 $item_change_prefix =
"item_change[$item[ref_id]]";
597 $item_active_prefix =
"item_active[$item[ref_id]]";
599 if ($item[
'type'] ==
'grp' or 600 $item[
'type'] ==
'fold') {
601 $this->tpl->setVariable(
"TITLE_LINK",
ilLink::_getLink($item[
'ref_id'], $item[
'type']));
603 $this->tpl->setVariable(
"TITLE_LINK_NAME", $item[
'title']);
605 if (!$item[
'title'] &&
606 $item[
'type'] ==
'sess') {
607 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
612 $this->tpl->setVariable(
"TITLE", $item[
'title']);
615 if (strlen($item[
'description'])) {
616 $this->tpl->setCurrentBlock(
"item_description");
617 $this->tpl->setVariable(
"DESC", $item[
'description']);
618 $this->tpl->parseCurrentBlock();
622 $this->tpl->setCurrentBlock(
"tlt");
623 $this->tpl->setVariable(
"TXT_TLT", $this->lng->txt(
'meta_typical_learning_time'));
625 $this->tpl->parseCurrentBlock();
628 $this->tpl->setCurrentBlock(
"container_standard_row");
631 if (is_array(
$_POST[
'item'][
"$item[ref_id]"][
'sug_start'])) {
634 $start = $item[
'suggestion_start'];
636 $end = $item[
'suggestion_end'];
638 $this->tpl->setVariable(
641 $item_prefix .
"[sug_start]",
650 $this->tpl->setVariable(
"NAME_DURATION_A", $item_prefix .
"[duration_a]");
651 if (isset(
$_POST[
'item'][
"$item[ref_id]"][
'duration_a'])) {
652 $this->tpl->setVariable(
"VAL_DURATION_A", abs(
$_POST[
'item'][
"$item[ref_id]"][
'duration_a']));
654 $this->tpl->setVariable(
"VAL_DURATION_A", intval((
$end -
$start) / (60 * 60 * 24)));
661 $this->tpl->setVariable(
664 $item_prefix .
"[lim_end]",
673 $this->tpl->setVariable(
"NAME_CHANGE", $item_change_prefix .
"[change]");
674 $this->tpl->setVariable(
"NAME_ACTIVE", $item_active_prefix .
"[active]");
676 if (isset(
$_POST[
'item'])) {
677 $change =
$_POST[
'item_change'][
"$item[ref_id]"][
'change'];
678 $active =
$_POST[
'item_active'][
"$item[ref_id]"][
'active'];
680 $change = $item[
'changeable'];
684 $this->tpl->setVariable(
"CHECKED_ACTIVE", $active ?
'checked="checked"' :
'');
685 $this->tpl->setVariable(
"CHECKED_CHANGE", $change ?
'checked="checked"' :
'');
687 if (isset($this->failed[
"$item[ref_id]"])) {
688 $this->tpl->setVariable(
"ROWCLASS",
'tblrowmarked');
690 $this->tpl->setVariable(
"ROWCLASS",
ilUtil::switchColor($counter++,
'tblrow1',
'tblrow2'));
692 $this->tpl->parseCurrentBlock();
696 $this->tpl->setVariable(
"CHECKCLASS",
ilUtil::switchColor($counter++,
'tblrow1',
'tblrow2'));
697 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
'select_all'));
699 $this->tpl->setVariable(
"BTN_SAVE", $this->lng->txt(
'save'));
700 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
'cancel'));
707 $ilAccess = $DIC[
'ilAccess'];
710 if (!$ilAccess->checkAccess(
'read',
'', $this->container_obj->getRefId())) {
711 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),
$ilErr->WARNING);
713 $this->tabs_gui->clearSubTabs();
714 $this->tabs_gui->setTabActive(
'timings_timings');
718 include_once
'Services/Object/classes/class.ilObjectActivation.php';
728 $this->ctrl->returnToParent($this);
733 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_user_timings.html',
'Modules/Course');
734 $this->tabs_gui->clearSubTabs();
735 $this->tabs_gui->setTabActive(
'members');
737 if (!
$_GET[
'member_id']) {
739 $this->ctrl->returnToParent($this);
744 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
745 $this->tpl->setCurrentBlock(
"btn_cell");
746 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
'returnToMembers'));
747 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"back"));
748 $this->tpl->parseCurrentBlock();
752 $this->tpl->setVariable(
"HEADER_ALT", $this->lng->txt(
'obj_usr'));
753 $this->tpl->setVariable(
"TABLE_HEADER", $this->lng->txt(
'timings_of'));
755 $this->tpl->setVariable(
"USER_NAME",
$name[
'lastname'] .
', ' .
$name[
'firstname']);
757 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
'title'));
758 $this->tpl->setVariable(
"TXT_START_END", $this->lng->txt(
'crs_timings_short_start_end'));
759 $this->tpl->setVariable(
"TXT_INFO_START_END", $this->lng->txt(
'crs_timings_start_end_info'));
760 $this->tpl->setVariable(
"TXT_CHANGED", $this->lng->txt(
'crs_timings_changed'));
761 $this->tpl->setVariable(
"TXT_OWN_PRESETTING", $this->lng->txt(
'crs_timings_planed_start'));
762 $this->tpl->setVariable(
"TXT_INFO_OWN_PRESETTING", $this->lng->txt(
'crs_timings_from_until'));
764 include_once
'Services/Object/classes/class.ilObjectActivation.php';
766 foreach ($items as $item) {
776 include_once
'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
777 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
779 $this->lng->loadLanguageModule(
'meta');
781 include_once
'./Modules/Course/classes/Timings/class.ilTimingUser.php';
784 for (
$i = 0;
$i < $level;
$i++) {
785 $this->tpl->touchBlock(
'start_indent');
786 $this->tpl->touchBlock(
'end_indent');
788 if (strlen($item[
'description'])) {
789 $this->tpl->setCurrentBlock(
"item_description");
790 $this->tpl->setVariable(
"DESC", $item[
'description']);
791 $this->tpl->parseCurrentBlock();
794 $this->tpl->setCurrentBlock(
"tlt");
795 $this->tpl->setVariable(
"TXT_TLT", $this->lng->txt(
'meta_typical_learning_time'));
797 $this->tpl->parseCurrentBlock();
800 if (!$item[
'title'] &&
801 $item[
'type'] ==
'sess') {
802 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
807 $this->tpl->setCurrentBlock(
"title_plain");
808 $this->tpl->setVariable(
"TITLE", $item[
'title']);
809 $this->tpl->parseCurrentBlock();
811 $this->tpl->setCurrentBlock(
"container_standard_row");
813 $this->tpl->setVariable(
"ROWCLASS",
ilUtil::switchColor($this->counter++,
'tblrow1',
'tblrow2'));
814 #$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_'.$item['type'].'.svg')); 816 $this->tpl->setVariable(
"TYPE_ALT_IMG", $this->lng->txt(
'obj_' . $item[
'type']));
820 $this->tpl->setVariable(
'SUG_START', $usr_planed->getStart()->get(
IL_CAL_DATE));
823 $this->tpl->setVariable(
'SUG_END', $usr_planed->getEnd()->get(
IL_CAL_DATE));
829 if ($usr_planed->getPlanedStartingTime()) {
830 $start = $usr_planed->getPlanedStartingTime();
832 $start = $item[
'suggestion_start'];
836 if ($usr_planed->getPlanedEndingTime()
and 0) {
837 $end = $usr_planed->getPlanedEndingTime();
839 $end = $item[
'suggestion_end'];
841 if (
$start != $item[
'suggestion_start']
or $end != $item[
'suggestion_end']) {
843 $this->tpl->setVariable(
"OK_ALT", $this->lng->txt(
'crs_timings_changed'));
846 $this->tpl->setVariable(
"OK_ALT", $this->lng->txt(
'crs_timings_not_changed'));
851 $this->tpl->parseCurrentBlock();
865 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_usr_edit_timings_adv.html',
'Modules/Course');
867 $this->tabs_gui->clearSubTabs();
869 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
871 $this->tpl->setVariable(
"HEADER_ALT", $this->lng->txt(
'obj_crs'));
872 $this->tpl->setVariable(
"BLOCK_HEADER_CONTENT", $this->lng->txt(
'timings_usr_edit'));
874 if (!
$_SESSION[
'crs_timings_user_hidden']) {
875 $this->tpl->setVariable(
"SHOW_HIDE_TEXT", $this->lng->txt(
'show_details'));
876 $this->ctrl->setParameter($this,
'show_details', 1);
877 $this->tpl->setVariable(
"SHOW_HIDE_LINK", $this->ctrl->getLinkTarget($this,
'editUserTimings'));
879 $this->tpl->setVariable(
"SHOW_HIDE_TEXT", $this->lng->txt(
'hide_details'));
880 $this->ctrl->setParameter($this,
'show_details', 0);
881 $this->tpl->setVariable(
"SHOW_HIDE_LINK", $this->ctrl->getLinkTarget($this,
'editUserTimings'));
883 $this->ctrl->clearParameters($this);
884 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
'title'));
885 $this->tpl->setVariable(
"TXT_START_END", $this->lng->txt(
'crs_timings_short_start_end'));
886 $this->tpl->setVariable(
"TXT_INFO_START_END", $this->lng->txt(
'crs_timings_start_end_info'));
889 $this->tpl->setVariable(
"TXT_OWN_PRESETTING", $this->lng->txt(
'crs_timings_planed_start'));
890 $this->tpl->setVariable(
"TXT_INFO_OWN_PRESETTING", $this->lng->txt(
'crs_timings_start_end_info'));
892 $this->tpl->setVariable(
"TXT_DURATION", $this->lng->txt(
'crs_timings_time_frame'));
893 $this->tpl->setVariable(
"TXT_INFO_DURATION", $this->lng->txt(
'crs_timings_in_days'));
895 $this->tpl->setVariable(
"TXT_BTN_UPDATE", $this->lng->txt(
'save'));
896 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
'cancel'));
898 include_once
'Services/Object/classes/class.ilObjectActivation.php';
902 foreach ($sorted_items as $item) {
903 switch ($item[
'type']) {
916 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_usr_edit_timings.html',
'Modules/Course');
918 $this->tabs_gui->clearSubTabs();
920 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
922 $this->tpl->setVariable(
"HEADER_ALT", $this->lng->txt(
'obj_crs'));
924 if (!
$_SESSION[
'crs_timings_user_hidden']) {
925 $this->tpl->setVariable(
"SHOW_HIDE_TEXT", $this->lng->txt(
'show_details'));
926 $this->ctrl->setParameter($this,
'show_details', 1);
927 $this->tpl->setVariable(
"SHOW_HIDE_LINK", $this->ctrl->getLinkTarget($this,
'editUserTimings'));
929 $this->tpl->setVariable(
"SHOW_HIDE_TEXT", $this->lng->txt(
'hide_details'));
930 $this->ctrl->setParameter($this,
'show_details', 0);
931 $this->tpl->setVariable(
"SHOW_HIDE_LINK", $this->ctrl->getLinkTarget($this,
'editUserTimings'));
933 $this->ctrl->clearParameters($this);
935 $this->tpl->setVariable(
"BLOCK_HEADER_CONTENT", $this->lng->txt(
'timings_timings'));
936 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
'title'));
937 $this->tpl->setVariable(
"TXT_START", $this->lng->txt(
'crs_timings_sug_begin'));
938 $this->tpl->setVariable(
"TXT_END", $this->lng->txt(
'crs_timings_sug_end'));
940 include_once
'Services/Object/classes/class.ilObjectActivation.php';
944 foreach ($sorted_items as $item) {
945 switch ($item[
'type']) {
961 $ilAccess = $DIC[
'ilAccess'];
963 include_once
'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
964 include_once
'./Services/Link/classes/class.ilLink.php';
965 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
967 if (!$ilAccess->checkAccess(
'visible',
'', $item[
'ref_id'])) {
971 $this->lng->loadLanguageModule(
'meta');
975 for (
$i = 0;
$i < $level;
$i++) {
976 $this->tpl->touchBlock(
'start_indent');
977 $this->tpl->touchBlock(
'end_indent');
979 if (strlen($item[
'description'])) {
980 $this->tpl->setCurrentBlock(
"item_description");
981 $this->tpl->setVariable(
"DESC", $item[
'description']);
982 $this->tpl->parseCurrentBlock();
985 $this->tpl->setCurrentBlock(
"tlt");
986 $this->tpl->setVariable(
"TXT_TLT", $this->lng->txt(
'meta_typical_learning_time'));
988 $this->tpl->parseCurrentBlock();
991 if (!$item[
'title'] &&
992 $item[
'type'] ==
'sess') {
993 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
998 if ($ilAccess->checkAccess(
'read',
'', $item[
'ref_id'])) {
999 $this->tpl->setCurrentBlock(
"title_as_link");
1000 $this->tpl->setVariable(
"TITLE_LINK",
ilLink::_getLink($item[
'ref_id'], $item[
'type']));
1001 $this->tpl->setVariable(
"TITLE_NAME", $item[
'title']);
1002 $this->tpl->parseCurrentBlock();
1004 $this->tpl->setCurrentBlock(
"title_plain");
1005 $this->tpl->setVariable(
"TITLE", $item[
'title']);
1006 $this->tpl->parseCurrentBlock();
1008 $this->tpl->setCurrentBlock(
"container_standard_row");
1010 if (isset($this->invalid[
"$item[ref_id]"])) {
1011 $this->tpl->setVariable(
"ROWCLASS",
'tblrowmarked');
1013 $this->tpl->setVariable(
"ROWCLASS",
ilUtil::switchColor($this->counter++,
'tblrow1',
'tblrow2'));
1015 #$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_'.$item['type'].'.svg')); 1017 $this->tpl->setVariable(
"TYPE_ALT_IMG", $this->lng->txt(
'obj_' . $item[
'type']));
1025 if ($item[
'changeable']) {
1026 $item_prefix =
"item[" . $item[
'ref_id'] .
']';
1028 if (is_array(
$_POST[
'item'][
"$item[ref_id]"][
'own_start'])) {
1029 #echo "Start post<br>"; 1031 } elseif ($usr_planed->getPlanedStartingTime()) {
1032 #echo "Own start<br>"; 1033 $start = $usr_planed->getPlanedStartingTime();
1035 #echo "Empfehlung start<br>"; 1036 $start = $item[
'suggestion_start'];
1040 $this->tpl->setVariable(
1043 $item_prefix .
"[own_start]",
1052 if ($usr_planed->getPlanedEndingTime()) {
1053 #echo "Own End<br>"; 1054 $end = $usr_planed->getPlanedEndingTime();
1056 #echo "Empfehlung end<br>"; 1057 $end = $item[
'suggestion_end'];
1060 $this->tpl->setVariable(
"NAME_DURATION", $item_prefix .
"[duration]");
1063 if (isset(
$_POST[
'item'][
"$item[ref_id]"][
'duration'])) {
1064 $this->tpl->setVariable(
"VAL_DURATION",
$_POST[
'item'][
"$item[ref_id]"][
'duration']);
1066 $this->tpl->setVariable(
"VAL_DURATION", intval((
$end -
$start) / (60 * 60 * 24)));
1070 $this->tpl->parseCurrentBlock();
1072 if (!
$_SESSION[
'crs_timings_user_hidden']) {
1087 $ilObjDataCache = $DIC[
'ilObjDataCache'];
1088 include_once
'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
1090 $this->tabs_gui->clearSubTabs();
1093 $this->invalid = array();
1098 if (isset(
$data[
'duration'])) {
1099 $data[
'own_start'][
'd'] +=
$data[
'duration'];
1100 $tmp_planed->setPlanedEndingTime($this->
__toUnix(
$data[
'own_start'], array(
'h' => 23,
'm' => 55)));
1102 $tmp_planed->setPlanedEndingTime($this->
__toUnix(
$data[
'own_start']), array(
'h' => 23,
'm' => 55));
1104 if (!$tmp_planed->validate()) {
1105 $this->invalid[
$ref_id] = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId(
$ref_id));
1107 $all_items[] = $tmp_planed;
1109 if (count($this->invalid)) {
1110 $message = $this->lng->txt(
'crs_timings_update_error');
1111 $message .= (
"<br />" . $this->lng->txt(
'crs_materials') .
': ');
1112 $message .= (implode(
',', $this->invalid));
1117 foreach ($all_items as $new_item_obj) {
1118 $new_item_obj->update();
1120 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
1133 $item[
'suggestion_start'] = $this->
__toUnix(
$_POST[
'item'][$obj_id][
'sug_start']);
1134 if (isset(
$_POST[
'item'][$obj_id][
'sug_end'])) {
1136 $item[
'suggestion_end'] = $this->
__toUnix(
$_POST[
'item'][$obj_id][
'sug_end']);
1140 $item[
'duration_a'] =
$_POST[
'item'][
$obj_id][
'duration_a'];
1141 $item[
'duration_b'] =
$_POST[
'item'][
$obj_id][
'duration_b'];
1154 $ilAccess = $DIC->access();
1157 if (!$ilAccess->checkAccess(
'write',
'', $this->container_obj->getRefId())) {
1158 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),
$ilErr->WARNING);
1161 $this->tabs_gui->clearSubTabs();
1164 $all_items = array();
1165 include_once
'./Services/Calendar/classes/class.ilCalendarUtil.php';
1171 #$item_obj->setTimingStart($old_data['timing_start']); 1172 #$item_obj->setTimingEnd($old_data['timing_end']); 1173 #$item_obj->toggleVisible($old_data['visible']); 1174 $item_obj->toggleChangeable((
int)
$data[
'change']);
1181 if (($sug_start_dt instanceof
ilDate)
and ($sug_end_dt instanceof ilDate)) {
1182 include_once
'./Services/Calendar/classes/class.ilDateTime.php';
1187 $item_obj->setSuggestionStart($sug_start_dt->get(
IL_CAL_UNIX));
1188 $item_obj->setSuggestionEnd($sug_end_dt->get(
IL_CAL_UNIX));
1190 $failed[
'ref_id'] =
'crs_timing_err_valid_dates';
1195 ((
int) $data[
'sug_start_rel'] < 0)
or 1196 ((
int) $data[
'duration_a'] < 0)
1201 $item_obj->setSuggestionStartRelative($data[
'sug_start_rel']);
1202 $item_obj->setSuggestionEndRelative($data[
'sug_start_rel'] + $data[
'duration_a']);
1217 $this->course_obj->update();
1219 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
1234 $ilAccess = $DIC[
'ilAccess'];
1237 if (!$ilAccess->checkAccess(
'write',
'', $this->container_obj->getRefId())) {
1238 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),
$ilErr->WARNING);
1240 $this->failed = array();
1244 $all_items = array();
1250 $item_obj->setTimingType(
$_POST[
'item_active'][
$ref_id][
'active'] ?
1253 $item_obj->setTimingStart($old_data[
'timing_start']);
1254 $item_obj->setTimingEnd($old_data[
'timing_end']);
1255 $item_obj->setSuggestionStart($this->
__toUnix(
$data[
"sug_start"]));
1258 $data[
'sug_start'][
'd'] += abs(
$data[
'duration_a']);
1259 $item_obj->setSuggestionEnd($this->
__toUnix(
$data[
'sug_start'], array(
'h' => 23,
'm' => 55)));
1260 $item_obj->toggleVisible($old_data[
'visible']);
1261 $item_obj->toggleChangeable(
$_POST[
'item_change'][
$ref_id][
'change']);
1263 if (!$item_obj->validateActivation()) {
1264 $this->failed[
$ref_id] = $old_data[
'title'];
1266 $all_items[
$ref_id] = &$item_obj;
1270 if (count($this->failed)) {
1271 $message = $this->lng->txt(
'crs_timings_update_error');
1272 $message .= (
"<br />" . $this->lng->txt(
'crs_materials') .
': ');
1273 $message .= (implode(
',', $this->failed));
1280 foreach ($all_items as
$ref_id => $item_obj_new) {
1281 $item_obj_new->update(
$ref_id);
1283 ilUtil::sendSuccess($this->lng->txt(
'settings_saved'));
1290 if ($this->container_obj->getType() ==
'crs') {
1291 $this->container_gui->setContentSubTabs();
1299 $tree = $DIC[
'tree'];
1301 if ($this->container_obj->getType() ==
'crs') {
1305 $course_ref_id =
$tree->checkForParentType($this->container_obj->getRefId(),
'crs');
1313 return gmmktime(
$time[
'h'],
$time[
'm'], 0, $date[
'm'], $date[
'd'], $date[
'y']);
1318 return array(
'y' => date(
'Y', $a_unix_time),
1319 'm' => date(
'm', $a_unix_time),
1320 'd' => date(
'd', $a_unix_time));
1325 return array(
'h' => date(
'G', $a_unix_time),
1326 'm' => date(
'i', $a_unix_time),
1327 's' => date(
's', $a_unix_time));
1335 $tree = $DIC[
'tree'];
1337 $path_arr =
$tree->getPathFull($a_ref_id, $this->course_obj->getRefId());
1339 foreach ($path_arr as
$data) {
1343 $path .= $data[
'title'];
managePersonalTimings($failed=array())
Manage personal timings.
static _lookupName($a_user_id)
lookup user name
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
__toUnix($date, $time=array())
static getItems($a_parent_id, $a_with_list_data=true)
Get sub item data.
updatePersonalTimings()
Update personal timings type $ilAccess type $ilErr.
static getCmdSide()
Get Column Side of Current Command.
const IL_CRS_VIEW_TIMING_ABSOLUTE
static _getTypicalLearningTimeSeconds($a_rbac_id, $a_obj_id=0)
setColumnSettings($column_gui)
__renderItem($item, $level)
view()
Output course content.
getRightColumnHTML()
Display right column.
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.
__editAdvancedUserTimings()
static getTimingsItems($a_container_ref_id)
Get (sub) item data for timings view (no session material, no side blocks)
TableGUI class for timings administration.
static getItem($a_ref_id)
Get item data.
const TIMINGS_DEACTIVATED
__prepareTimeSelect($a_unix_time)
static getTypeIconPath($a_type, $a_obj_id, $a_size='small')
Get type icon path path Return image path for icon_xxx.pngs Or (if enabled) path to custom icon Depre...
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
getCenterColumnHTML()
Get center column.
catch(Exception $e) $message
static secondsToString($seconds, $force_with_seconds=false, $a_lng=null)
converts seconds to string: Long: 7 days 4 hour(s) ...
static getTimingsAdministrationItems($a_parent_id)
Get (sub) item data for timings administration view (active/inactive)
Column user interface class.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static hasChangeableTimings($a_ref_id)
Check if there is any active changeable timing (in subtree)
static _lookupObjId($a_id)
static _appointmentToString($start, $end, $fulltime)
static _checkAllConditionsOfTarget($a_target_ref_id, $a_target_id, $a_target_type="", $a_usr_id=0)
checks wether all conditions of a target object are fulfilled
manageTimings($failed_items=array())
Manage timings type $ilAccess type $ilErr.
buildFrameTarget($a_type, $a_child=0, $a_obj_id=0)
STATIC, do not use $this inside!
static makeDateSelect($prefix, $year="", $month="", $day="", $startyear="", $a_long_month=true, $a_further_options=array(), $emptyoption=false)
Creates a combination of HTML selects for date inputs.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
TableGUI class for timings administration.
static getScreenMode()
Get Screen Mode for current command.
__construct($container_gui_obj)
Constructor public.
setPlanedStartingTime($a_time)
static switchColor($a_num, $a_css1, $a_css2)
switches style sheets for each even $a_num (used for changing colors of different result rows) ...
Class ilCourseContentGUI.
static _lookupAppointment($a_obj_id)
lookup appointment
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
__forwardToColumnGUI()
Get columngui output.
__prepareDateSelect($a_unix_time)
if(empty($password)) $table
TableGUI class for editing personal timings.
__renderUserItem($item, $level)
Class ilObjectActivation.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static parseIncomingDate($a_value, $a_add_time=null)
Try to parse incoming value to date object.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.