38 $this->lng->loadLanguageModule(
'crs');
39 $this->tabs_gui = $ilTabs;
41 $this->container_gui =&$container_gui_obj;
42 $this->container_obj =&$this->container_gui->object;
51 if (!$ilAccess->checkAccess(
'read',
'', $this->container_obj->getRefId())) {
52 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'), $ilErr->WARNING);
59 $this->tabs_gui->setTabActive(
'view_content');
60 $cmd = $this->ctrl->getCmd();
62 switch ($this->ctrl->getNextClass($this)) {
63 case 'ilcoursearchivesgui':
64 $this->__forwardToArchivesGUI();
68 $ilCtrl->saveParameterByClass(
"ilcolumngui",
"col_return");
69 $ilTabs->setSubTabActive(
"crs_content");
80 if ((!$this->is_tutor and
81 $this->container_obj->getType() ==
'crs' and
82 $this->container_obj->enabledObjectiveView()) ||
83 $_GET[
"col_return"] ==
"objectives") {
84 $this->use_objective_presentation =
true;
104 if (
$_SESSION[
'crs_timings_panel'][$this->course_obj->getId()]) {
105 return 'editTimings';
107 if ($ilAccess->checkAccess(
'write',
'', $this->container_obj->getRefId())) {
110 if ($this->container_obj->getType() ==
'crs' and
112 return 'editUserTimings';
119 include_once
'./Modules/Course/classes/class.ilCourseStart.php';
123 if ($ilAccess->checkAccess(
'write',
'', $this->course_obj->getRefId())) {
126 $this->start_obj =
new ilCourseStart($this->course_obj->getRefId(), $this->course_obj->getId());
127 if (count($this->start_obj->getStartObjects()) and !$this->start_obj->allFullfilled($ilUser->getId())) {
135 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
136 include_once
'./Services/Repository/classes/class.ilRepositoryExplorer.php';
137 include_once
'./Services/Link/classes/class.ilLink.php';
141 $this->tabs_gui->setSubTabActive(
'crs_content');
143 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_start_view.html",
'Modules/Course');
144 $this->tpl->setVariable(
"INFO_STRING", $this->lng->txt(
'crs_info_start'));
145 $this->tpl->setVariable(
"TBL_TITLE_START", $this->lng->txt(
'crs_table_start_objects'));
146 $this->tpl->setVariable(
"HEADER_NR", $this->lng->txt(
'crs_nr'));
147 $this->tpl->setVariable(
"HEADER_DESC", $this->lng->txt(
'description'));
148 $this->tpl->setVariable(
"HEADER_EDITED", $this->lng->txt(
'crs_objective_accomplished'));
151 $lm_continue =
new ilCourseLMHistory($this->course_obj->getRefId(), $ilUser->getId());
155 foreach ($this->start_obj->getStartObjects() as $start) {
156 $obj_id = $ilObjDataCache->lookupObjId($start[
'item_ref_id']);
157 $ref_id = $start[
'item_ref_id'];
164 $obj_frame = $obj_frame ? $obj_frame :
'';
167 $obj_frame =
$type ==
'tst' ?
'' : $obj_frame;
171 if ($ilAccess->checkAccess(
'read',
'',
$ref_id)) {
172 $this->tpl->setCurrentBlock(
"start_read");
173 $this->tpl->setVariable(
"READ_TITLE_START", $ilObjDataCache->lookupTitle(
$obj_id));
174 $this->tpl->setVariable(
"READ_TARGET_START", $obj_frame);
175 $this->tpl->setVariable(
"READ_LINK_START", $obj_link .
'&crs_show_result=' . $this->course_obj->getRefId());
176 $this->tpl->parseCurrentBlock();
178 $this->tpl->setCurrentBlock(
"start_visible");
179 $this->tpl->setVariable(
"VISIBLE_LINK_START", $ilObjDataCache->lookupTitle(
$obj_id));
180 $this->tpl->parseCurrentBlock();
184 if (isset($continue_data[
$ref_id])) {
185 $this->tpl->setCurrentBlock(
"link");
187 $continue_data[$ref_id][
'lm_page_id'])));
188 #$this->tpl->setVariable("CONTINUE_LINK_TARGET",$target); 189 $this->tpl->setVariable(
"LINK_NAME", $this->lng->txt(
'continue_work'));
190 $this->tpl->parseCurrentBlock();
194 if (!$ilUser->isDesktopItem($ref_id,
$type) and
195 $this->course_obj->getAboStatus()) {
196 if ($ilAccess->checkAccess(
'read',
'', $ref_id)) {
197 $this->tpl->setCurrentBlock(
"link");
198 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'item_ref_id', $ref_id);
199 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'item_id', $ref_id);
200 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'type',
$type);
202 $this->tpl->setVariable(
"LINK_HREF", $this->ctrl->getLinkTarget($this->container_gui,
'addToDesk'));
203 $this->tpl->setVariable(
"LINK_NAME", $this->lng->txt(
"to_desktop"));
204 $this->tpl->parseCurrentBlock();
206 } elseif ($this->course_obj->getAboStatus()) {
207 $this->tpl->setCurrentBlock(
"link");
208 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'item_ref_id', $ref_id);
209 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'item_id', $ref_id);
210 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'type',
$type);
212 $this->tpl->setVariable(
"LINK_HREF", $this->ctrl->getLinkTarget($this->container_gui,
'removeFromDesk'));
213 $this->tpl->setVariable(
"LINK_NAME", $this->lng->txt(
"unsubscribe"));
214 $this->tpl->parseCurrentBlock();
219 if (strlen($ilObjDataCache->lookupDescription(
$obj_id))) {
220 $this->tpl->setCurrentBlock(
"start_description");
221 $this->tpl->setVariable(
"DESCRIPTION_START", $ilObjDataCache->lookupDescription(
$obj_id));
222 $this->tpl->parseCurrentBlock();
226 if ($this->start_obj->isFullfilled($ilUser->getId(),
$ref_id)) {
227 $accomplished =
'accomplished';
230 $accomplished =
'not_accomplished';
233 $this->tpl->setCurrentBlock(
"start_row");
234 $this->tpl->setVariable(
"EDITED_IMG", $icon);
235 $this->tpl->setVariable(
"EDITED_ALT", $this->lng->txt(
'crs_objective_' . $accomplished));
236 $this->tpl->setVariable(
"ROW_CLASS",
'option_value');
237 $this->tpl->setVariable(
"ROW_CLASS_CENTER",
'option_value_center');
238 $this->tpl->setVariable(
"OBJ_NR_START", ++
$counter .
'.');
239 $this->tpl->parseCurrentBlock();
250 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
254 $this->container_obj->getType(),
255 $this->container_obj->getRefId(),
263 if (!$this->no_right_column) {
275 $ilCtrl->saveParameterByClass(
"ilcolumngui",
"col_return");
280 include_once(
"Services/Block/classes/class.ilColumnGUI.php");
289 if ($ilCtrl->getNextClass() ==
"ilcolumngui" &&
292 $html = $ilCtrl->forwardCommand($column_gui);
294 if (!$ilCtrl->isAsynch()) {
295 $html = $ilCtrl->getHTML($column_gui);
304 global $ilAccess,
$lng;
306 $column_gui->setRepositoryMode(
true);
307 $column_gui->setEnableEdit(
false);
308 $column_gui->setBlockProperty(
311 $lng->txt(
"crs_news")
314 include_once
"Services/Object/classes/class.ilObjectActivation.php";
315 $grouped_items =
array();
317 $grouped_items[$item[
"type"]][] = $item;
320 $column_gui->setRepositoryItems($grouped_items);
321 if ($ilAccess->checkAccess(
"write",
"", $this->container_obj->getRefId())) {
322 $column_gui->setEnableEdit(
true);
326 if ($this->is_tutor &&
327 $this->container_gui->isActiveAdministrationPanel()) {
328 $column_gui->setEnableMovement(
true);
332 if ($this->is_tutor) {
333 $column_gui->setBlockProperty(
"news",
"settings",
true);
335 $column_gui->setBlockProperty(
"news",
"default_visibility_option",
true);
336 $column_gui->setBlockProperty(
"news",
"hide_news_block_option",
true);
339 if ($this->container_gui->isActiveAdministrationPanel()) {
340 $column_gui->setAdminCommands(
true);
352 include_once(
"Services/Block/classes/class.ilColumnGUI.php");
357 if (!$ilCtrl->isAsynch()) {
364 $html = $ilCtrl->forwardCommand($column_gui);
370 $html = $ilCtrl->forwardCommand($column_gui);
374 $this->getDefaultView();
386 include_once
'Services/MetaData/classes/class.ilMDEducational.php';
387 include_once
'./Services/Link/classes/class.ilLink.php';
389 $this->lng->loadLanguageModule(
'meta');
391 if (!$ilAccess->checkAccess(
'write',
'', $this->container_obj->getRefId())) {
392 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'), $ilErr->WARNING);
395 $this->tabs_gui->setSubTabActive(
'timings_timings');
397 include_once
'Services/Object/classes/class.ilObjectActivation.php';
400 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_edit_items.html',
'Modules/Course');
401 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
403 $this->tpl->setVariable(
"HEADER_ALT", $this->lng->txt(
'crs_materials'));
404 $this->tpl->setVariable(
"BLOCK_HEADER_CONTENT", $this->lng->txt(
'edit_timings_list'));
405 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
'title'));
408 $this->tpl->setVariable(
"TXT_DURATION", $this->lng->txt(
'crs_timings_time_frame'));
409 $this->tpl->setVariable(
"TXT_INFO_DURATION", $this->lng->txt(
'crs_timings_in_days'));
411 $this->tpl->setVariable(
"TXT_START_END", $this->lng->txt(
'crs_timings_short_start_end'));
412 $this->tpl->setVariable(
"TXT_INFO_START_END", $this->lng->txt(
'crs_timings_start_end_info'));
414 $this->tpl->setVariable(
"TXT_CHANGEABLE", $this->lng->txt(
'crs_timings_short_changeable'));
416 $this->tpl->setVariable(
"TXT_INFO_LIMIT", $this->lng->txt(
'crs_timings_from_until'));
417 $this->tpl->setVariable(
"TXT_LIMIT", $this->lng->txt(
'crs_timings_short_limit_start_end'));
418 $this->tpl->setVariable(
"TXT_ACTIVE", $this->lng->txt(
'crs_timings_short_active'));
419 $this->tpl->setVariable(
"TXT_INFO_ACTIVE", $this->lng->txt(
'crs_timings_info_active'));
422 foreach ($this->cont_arr as $item) {
423 if ($item[
'type'] ==
'itgr') {
427 $item_prefix =
"item[$item[ref_id]]";
428 $item_change_prefix =
"item_change[$item[ref_id]]";
429 $item_active_prefix =
"item_active[$item[ref_id]]";
431 if ($item[
'type'] ==
'grp' or
432 $item[
'type'] ==
'fold') {
433 $this->tpl->setVariable(
"TITLE_LINK",
ilLink::_getLink($item[
'ref_id'], $item[
'type']));
435 $this->tpl->setVariable(
"TITLE_LINK_NAME", $item[
'title']);
437 if (!$item[
'title'] &&
438 $item[
'type'] ==
'sess') {
439 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
444 $this->tpl->setVariable(
"TITLE", $item[
'title']);
447 if (strlen($item[
'description'])) {
448 $this->tpl->setCurrentBlock(
"item_description");
449 $this->tpl->setVariable(
"DESC", $item[
'description']);
450 $this->tpl->parseCurrentBlock();
454 $this->tpl->setCurrentBlock(
"tlt");
455 $this->tpl->setVariable(
"TXT_TLT", $this->lng->txt(
'meta_typical_learning_time'));
457 $this->tpl->parseCurrentBlock();
460 $this->tpl->setCurrentBlock(
"container_standard_row");
463 if (is_array(
$_POST[
'item'][
"$item[ref_id]"][
'sug_start'])) {
464 $start = $this->
__toUnix(
$_POST[
'item'][
"$item[ref_id]"][
'sug_start']);
466 $start = $item[
'suggestion_start'];
468 $end = $item[
'suggestion_end'];
470 $this->tpl->setVariable(
473 $item_prefix .
"[sug_start]",
482 $this->tpl->setVariable(
"NAME_DURATION_A", $item_prefix .
"[duration_a]");
483 if (isset(
$_POST[
'item'][
"$item[ref_id]"][
'duration_a'])) {
484 $this->tpl->setVariable(
"VAL_DURATION_A", abs(
$_POST[
'item'][
"$item[ref_id]"][
'duration_a']));
486 $this->tpl->setVariable(
"VAL_DURATION_A", intval((
$end-$start)/(60*60*24)));
492 if (is_array(
$_POST[
'item'][
"$item[ref_id]"][
'lim_end'])) {
495 $end = $item[
'latest_end'];
499 $this->tpl->setVariable(
502 $item_prefix .
"[lim_end]",
511 $this->tpl->setVariable(
"NAME_CHANGE", $item_change_prefix .
"[change]");
512 $this->tpl->setVariable(
"NAME_ACTIVE", $item_active_prefix .
"[active]");
514 if (isset(
$_POST[
'item'])) {
515 $change =
$_POST[
'item_change'][
"$item[ref_id]"][
'change'];
516 $active =
$_POST[
'item_active'][
"$item[ref_id]"][
'active'];
518 $change = $item[
'changeable'];
522 $this->tpl->setVariable(
"CHECKED_ACTIVE", $active ?
'checked="checked"' :
'');
523 $this->tpl->setVariable(
"CHECKED_CHANGE", $change ?
'checked="checked"' :
'');
525 if (isset($this->failed[
"$item[ref_id]"])) {
526 $this->tpl->setVariable(
"ROWCLASS",
'tblrowmarked');
530 $this->tpl->parseCurrentBlock();
535 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
'select_all'));
537 $this->tpl->setVariable(
"BTN_SAVE", $this->lng->txt(
'save'));
538 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
'cancel'));
545 include_once
'Modules/Course/classes/Timings/class.ilTimingAccepted.php';
546 $accept_obj =
new ilTimingAccepted($this->course_obj->getId(), $ilUser->getId());
548 include_once(
'Services/Form/classes/class.ilPropertyFormGUI.php');
550 $form->setFormAction($this->ctrl->getFormAction($this,
'saveAcceptance'));
551 $form->setTitle($this->lng->txt(
'timing_accept_table'));
554 $accept->
setChecked($accept_obj->isAccepted());
555 $form->addItem($accept);
558 $remark->
setValue($accept_obj->getRemark());
559 $form->addItem($remark);
563 $form->addItem($tutor);
565 $form->addCommandButton(
'saveAcceptance', $this->lng->txt(
'save'));
566 $this->tpl->setVariable(
"FORM",
$form->getHTML());
573 include_once
'Modules/Course/classes/Timings/class.ilTimingAccepted.php';
574 $accept_obj =
new ilTimingAccepted($this->course_obj->getId(), $ilUser->getId());
577 $accept_obj->accept(
$_POST[
'accepted']);
578 $accept_obj->setVisible(
$_POST[
'tutor']);
579 $accept_obj->update();
586 if (
$_SESSION[
'crs_timings_panel'][$this->course_obj->getId()]) {
591 if (!$ilAccess->checkAccess(
'read',
'', $this->container_obj->getRefId())) {
592 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'), $ilErr->WARNING);
594 $this->tabs_gui->setSubTabActive(
'timings_timings');
598 include_once
'Services/Object/classes/class.ilObjectActivation.php';
608 $this->ctrl->returnToParent($this);
613 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_user_timings.html',
'Modules/Course');
614 $this->tabs_gui->clearSubTabs();
615 $this->tabs_gui->setTabActive(
'members');
617 if (!
$_GET[
'member_id']) {
619 $this->ctrl->returnToParent($this);
624 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
625 $this->tpl->setCurrentBlock(
"btn_cell");
626 $this->tpl->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this,
'returnToMembers'));
627 $this->tpl->setVariable(
"BTN_TXT", $this->lng->txt(
"back"));
628 $this->tpl->parseCurrentBlock();
630 include_once
'Modules/Course/classes/Timings/class.ilTimingAccepted.php';
633 if ($usr_accepted->isAccepted()) {
635 $this->tpl->setVariable(
"ACC_ALT", $this->lng->txt(
'timing_accepted'));
638 $this->tpl->setVariable(
"ACC_ALT", $this->lng->txt(
'timing_not_accepted'));
640 if ($usr_accepted->isVisible() and strlen($usr_accepted->getRemark())) {
641 $this->tpl->setVariable(
"REMARK", nl2br($usr_accepted->getRemark()));
643 $this->tpl->setVariable(
"REMARK", $this->lng->txt(
'not_available'));
646 $this->tpl->setVariable(
"TIMING_ACCEPT", $this->lng->txt(
'timing_accept_table'));
647 $this->tpl->setVariable(
"TXT_ACCEPTED", $this->lng->txt(
'timing_user_accepted'));
648 $this->tpl->setVariable(
"TXT_REMARK", $this->lng->txt(
'timing_remark'));
651 $this->tpl->setVariable(
"HEADER_ALT", $this->lng->txt(
'obj_usr'));
652 $this->tpl->setVariable(
"TABLE_HEADER", $this->lng->txt(
'timings_of'));
654 $this->tpl->setVariable(
"USER_NAME",
$name[
'lastname'] .
', ' .
$name[
'firstname']);
656 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
'title'));
657 $this->tpl->setVariable(
"TXT_START_END", $this->lng->txt(
'crs_timings_short_start_end'));
658 $this->tpl->setVariable(
"TXT_INFO_START_END", $this->lng->txt(
'crs_timings_start_end_info'));
659 $this->tpl->setVariable(
"TXT_CHANGED", $this->lng->txt(
'crs_timings_changed'));
660 $this->tpl->setVariable(
"TXT_OWN_PRESETTING", $this->lng->txt(
'crs_timings_planed_start'));
661 $this->tpl->setVariable(
"TXT_INFO_OWN_PRESETTING", $this->lng->txt(
'crs_timings_from_until'));
663 include_once
'Services/Object/classes/class.ilObjectActivation.php';
665 foreach ($items as $item) {
675 include_once
'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
676 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
678 $this->lng->loadLanguageModule(
'meta');
681 for (
$i = 0;
$i < $level;
$i++) {
682 $this->tpl->touchBlock(
'start_indent');
683 $this->tpl->touchBlock(
'end_indent');
685 if (strlen($item[
'description'])) {
686 $this->tpl->setCurrentBlock(
"item_description");
687 $this->tpl->setVariable(
"DESC", $item[
'description']);
688 $this->tpl->parseCurrentBlock();
691 $this->tpl->setCurrentBlock(
"tlt");
692 $this->tpl->setVariable(
"TXT_TLT", $this->lng->txt(
'meta_typical_learning_time'));
694 $this->tpl->parseCurrentBlock();
697 if (!$item[
'title'] &&
698 $item[
'type'] ==
'sess') {
699 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
704 $this->tpl->setCurrentBlock(
"title_plain");
705 $this->tpl->setVariable(
"TITLE", $item[
'title']);
706 $this->tpl->parseCurrentBlock();
708 $this->tpl->setCurrentBlock(
"container_standard_row");
710 $this->tpl->setVariable(
"ROWCLASS",
ilUtil::switchColor($this->counter++,
'tblrow1',
'tblrow2'));
711 #$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_'.$item['type'].'.svg')); 713 $this->tpl->setVariable(
"TYPE_ALT_IMG", $this->lng->txt(
'obj_' . $item[
'type']));
721 if ($usr_planed->getPlanedStartingTime()) {
722 $start = $usr_planed->getPlanedStartingTime();
724 $start = $item[
'suggestion_start'];
728 if ($usr_planed->getPlanedEndingTime()) {
729 $end = $usr_planed->getPlanedEndingTime();
731 $end = $item[
'suggestion_end'];
733 if ($start != $item[
'suggestion_start'] or
$end != $item[
'suggestion_end']) {
735 $this->tpl->setVariable(
"OK_ALT", $this->lng->txt(
'crs_timings_changed'));
738 $this->tpl->setVariable(
"OK_ALT", $this->lng->txt(
'crs_timings_not_changed'));
743 $this->tpl->parseCurrentBlock();
757 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_usr_edit_timings_adv.html',
'Modules/Course');
761 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
763 $this->tpl->setVariable(
"HEADER_ALT", $this->lng->txt(
'obj_crs'));
764 $this->tpl->setVariable(
"BLOCK_HEADER_CONTENT", $this->lng->txt(
'timings_usr_edit'));
766 if (!
$_SESSION[
'crs_timings_user_hidden']) {
767 $this->tpl->setVariable(
"SHOW_HIDE_TEXT", $this->lng->txt(
'show_details'));
768 $this->ctrl->setParameter($this,
'show_details', 1);
769 $this->tpl->setVariable(
"SHOW_HIDE_LINK", $this->ctrl->getLinkTarget($this,
'editUserTimings'));
771 $this->tpl->setVariable(
"SHOW_HIDE_TEXT", $this->lng->txt(
'hide_details'));
772 $this->ctrl->setParameter($this,
'show_details', 0);
773 $this->tpl->setVariable(
"SHOW_HIDE_LINK", $this->ctrl->getLinkTarget($this,
'editUserTimings'));
775 $this->ctrl->clearParameters($this);
776 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
'title'));
777 $this->tpl->setVariable(
"TXT_START_END", $this->lng->txt(
'crs_timings_short_start_end'));
778 $this->tpl->setVariable(
"TXT_INFO_START_END", $this->lng->txt(
'crs_timings_start_end_info'));
780 $this->tpl->setVariable(
"TXT_LIMIT", $this->lng->txt(
'crs_timings_short_limit_start_end'));
781 $this->tpl->setVariable(
"TXT_INFO_LIMIT", $this->lng->txt(
'crs_timings_from_until'));
783 $this->tpl->setVariable(
"TXT_OWN_PRESETTING", $this->lng->txt(
'crs_timings_planed_start'));
784 $this->tpl->setVariable(
"TXT_INFO_OWN_PRESETTING", $this->lng->txt(
'crs_timings_start_end_info'));
786 $this->tpl->setVariable(
"TXT_DURATION", $this->lng->txt(
'crs_timings_time_frame'));
787 $this->tpl->setVariable(
"TXT_INFO_DURATION", $this->lng->txt(
'crs_timings_in_days'));
789 $this->tpl->setVariable(
"TXT_BTN_UPDATE", $this->lng->txt(
'save'));
790 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
'cancel'));
792 include_once
'Services/Object/classes/class.ilObjectActivation.php';
796 foreach ($sorted_items as $item) {
797 switch ($item[
'type']) {
810 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_usr_edit_timings.html',
'Modules/Course');
815 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
817 $this->tpl->setVariable(
"HEADER_ALT", $this->lng->txt(
'obj_crs'));
819 if (!
$_SESSION[
'crs_timings_user_hidden']) {
820 $this->tpl->setVariable(
"SHOW_HIDE_TEXT", $this->lng->txt(
'show_details'));
821 $this->ctrl->setParameter($this,
'show_details', 1);
822 $this->tpl->setVariable(
"SHOW_HIDE_LINK", $this->ctrl->getLinkTarget($this,
'editUserTimings'));
824 $this->tpl->setVariable(
"SHOW_HIDE_TEXT", $this->lng->txt(
'hide_details'));
825 $this->ctrl->setParameter($this,
'show_details', 0);
826 $this->tpl->setVariable(
"SHOW_HIDE_LINK", $this->ctrl->getLinkTarget($this,
'editUserTimings'));
828 $this->ctrl->clearParameters($this);
830 $this->tpl->setVariable(
"BLOCK_HEADER_CONTENT", $this->lng->txt(
'timings_timings'));
831 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
'title'));
832 $this->tpl->setVariable(
"TXT_START", $this->lng->txt(
'crs_timings_sug_begin'));
833 $this->tpl->setVariable(
"TXT_END", $this->lng->txt(
'crs_timings_sug_end'));
835 include_once
'Services/Object/classes/class.ilObjectActivation.php';
839 foreach ($sorted_items as $item) {
840 switch ($item[
'type']) {
855 include_once
'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
856 include_once
'./Services/Link/classes/class.ilLink.php';
857 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
859 if (!$ilAccess->checkAccess(
'visible',
'', $item[
'ref_id'])) {
863 $this->lng->loadLanguageModule(
'meta');
865 $usr_planed =
new ilTimingPlaned($item[
'ref_id'], $ilUser->getId());
867 for (
$i = 0;
$i < $level;
$i++) {
868 $this->tpl->touchBlock(
'start_indent');
869 $this->tpl->touchBlock(
'end_indent');
871 if (strlen($item[
'description'])) {
872 $this->tpl->setCurrentBlock(
"item_description");
873 $this->tpl->setVariable(
"DESC", $item[
'description']);
874 $this->tpl->parseCurrentBlock();
877 $this->tpl->setCurrentBlock(
"tlt");
878 $this->tpl->setVariable(
"TXT_TLT", $this->lng->txt(
'meta_typical_learning_time'));
880 $this->tpl->parseCurrentBlock();
883 if (!$item[
'title'] &&
884 $item[
'type'] ==
'sess') {
885 include_once(
'./Modules/Session/classes/class.ilSessionAppointment.php');
890 if ($ilAccess->checkAccess(
'read',
'', $item[
'ref_id'])) {
891 $this->tpl->setCurrentBlock(
"title_as_link");
892 $this->tpl->setVariable(
"TITLE_LINK",
ilLink::_getLink($item[
'ref_id'], $item[
'type']));
893 $this->tpl->setVariable(
"TITLE_NAME", $item[
'title']);
894 $this->tpl->parseCurrentBlock();
896 $this->tpl->setCurrentBlock(
"title_plain");
897 $this->tpl->setVariable(
"TITLE", $item[
'title']);
898 $this->tpl->parseCurrentBlock();
900 $this->tpl->setCurrentBlock(
"container_standard_row");
902 if (isset($this->invalid[
"$item[ref_id]"])) {
903 $this->tpl->setVariable(
"ROWCLASS",
'tblrowmarked');
905 $this->tpl->setVariable(
"ROWCLASS",
ilUtil::switchColor($this->counter++,
'tblrow1',
'tblrow2'));
907 #$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_'.$item['type'].'.svg')); 909 $this->tpl->setVariable(
"TYPE_ALT_IMG", $this->lng->txt(
'obj_' . $item[
'type']));
917 if ($item[
'changeable']) {
918 $item_prefix =
"item[" . $item[
'ref_id'] .
']';
920 if (is_array(
$_POST[
'item'][
"$item[ref_id]"][
'own_start'])) {
921 #echo "Start post<br>"; 922 $start = $this->
__toUnix(
$_POST[
'item'][
"$item[ref_id]"][
'own_start']);
923 } elseif ($usr_planed->getPlanedStartingTime()) {
924 #echo "Own start<br>"; 925 $start = $usr_planed->getPlanedStartingTime();
927 #echo "Empfehlung start<br>"; 928 $start = $item[
'suggestion_start'];
932 $this->tpl->setVariable(
935 $item_prefix .
"[own_start]",
944 if ($usr_planed->getPlanedEndingTime()) {
946 $end = $usr_planed->getPlanedEndingTime();
948 #echo "Empfehlung end<br>"; 949 $end = $item[
'suggestion_end'];
952 $this->tpl->setVariable(
"NAME_DURATION", $item_prefix .
"[duration]");
955 if (isset(
$_POST[
'item'][
"$item[ref_id]"][
'duration'])) {
956 $this->tpl->setVariable(
"VAL_DURATION",
$_POST[
'item'][
"$item[ref_id]"][
'duration']);
958 $this->tpl->setVariable(
"VAL_DURATION", intval((
$end - $start) / (60 * 60 * 24)));
964 $this->tpl->parseCurrentBlock();
966 if (!
$_SESSION[
'crs_timings_user_hidden']) {
977 global $ilAccess, $ilToolbar;
979 if (!$ilAccess->checkAccess(
'write',
'', $this->container_obj->getRefId())) {
983 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
986 if (!
$_SESSION[
'crs_timings_panel'][$this->course_obj->getId()]) {
987 $btn->setCaption(
"timings_timings_on");
988 $btn->setUrl($this->ctrl->getLinkTarget($this,
'timingsOn'));
990 $btn->setCaption(
"timings_timings_off");
991 $btn->setUrl($this->ctrl->getLinkTarget($this,
'timingsOff'));
994 $ilToolbar->addButtonInstance($btn);
1000 $_SESSION[
'crs_timings_panel'][$this->course_obj->getId()] = 1;
1002 $ilTabs->clearSubTabs();
1010 $_SESSION[
'crs_timings_panel'][$this->course_obj->getId()] = 0;
1012 $ilTabs->clearSubTabs();
1020 global
$ilUser,$ilObjDataCache;
1021 include_once
'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
1024 $this->invalid =
array();
1029 if (isset(
$data[
'duration'])) {
1030 $data[
'own_start'][
'd'] +=
$data[
'duration'];
1031 $tmp_planed->setPlanedEndingTime($this->
__toUnix(
$data[
'own_start'],
array(
'h' => 23,
'm' => 55)));
1033 $tmp_planed->setPlanedEndingTime($this->
__toUnix(
$data[
'own_start']),
array(
'h' => 23,
'm' => 55));
1035 if (!$tmp_planed->validate()) {
1036 $this->invalid[
$ref_id] = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId(
$ref_id));
1038 $all_items[] = $tmp_planed;
1040 if (count($this->invalid)) {
1041 $message = $this->lng->txt(
'crs_timings_update_error');
1042 $message .= (
"<br />" . $this->lng->txt(
'crs_materials') .
': ');
1043 $message .= (implode(
',', $this->invalid));
1048 foreach ($all_items as $new_item_obj) {
1049 $new_item_obj->update();
1064 $item[
'suggestion_start'] = $this->
__toUnix(
$_POST[
'item'][$obj_id][
'sug_start']);
1065 if (isset(
$_POST[
'item'][$obj_id][
'sug_end'])) {
1067 $item[
'suggestion_end'] = $this->
__toUnix(
$_POST[
'item'][$obj_id][
'sug_end']);
1069 $item[
'earliest_start'] = $this->
__toUnix(
$_POST[
'item'][$obj_id][
'lim_start']);
1070 $item[
'latest_end'] = $this->
__toUnix(
$_POST[
'item'][$obj_id][
'lim_end']);
1073 $item[
'duration_a'] =
$_POST[
'item'][
$obj_id][
'duration_a'];
1074 $item[
'duration_b'] =
$_POST[
'item'][
$obj_id][
'duration_b'];
1081 include_once
'Services/Object/classes/class.ilObjectActivation.php';
1085 if (!$ilAccess->checkAccess(
'write',
'', $this->container_obj->getRefId())) {
1086 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'), $ilErr->WARNING);
1088 $this->failed =
array();
1092 $all_items =
array();
1098 $item_obj->setTimingType(
$_POST[
'item_active'][
$ref_id][
'active'] ?
1101 $item_obj->setTimingStart($old_data[
'timing_start']);
1102 $item_obj->setTimingEnd($old_data[
'timing_end']);
1103 $item_obj->setSuggestionStart($this->
__toUnix(
$data[
"sug_start"]));
1106 $data[
'sug_start'][
'd'] += abs(
$data[
'duration_a']);
1107 $item_obj->setSuggestionEnd($this->
__toUnix(
$data[
'sug_start'],
array(
'h' => 23,
'm' => 55)));
1109 $item_obj->setEarliestStart(
time());
1110 $item_obj->setLatestEnd($this->
__toUnix(
$data[
'lim_end'],
array(
'h' => 23,
'm' => 55)));
1112 $item_obj->toggleVisible($old_data[
'visible']);
1113 $item_obj->toggleChangeable(
$_POST[
'item_change'][
$ref_id][
'change']);
1115 if (!$item_obj->validateActivation()) {
1116 $this->failed[
$ref_id] = $old_data[
'title'];
1118 $all_items[
$ref_id] =&$item_obj;
1122 if (count($this->failed)) {
1123 $message = $this->lng->txt(
'crs_timings_update_error');
1124 $message .= (
"<br />" . $this->lng->txt(
'crs_materials') .
': ');
1125 $message .= (implode(
',', $this->failed));
1132 foreach ($all_items as
$ref_id => $item_obj_new) {
1133 $item_obj_new->update(
$ref_id);
1142 if ($this->container_obj->getType() ==
'crs') {
1143 $this->container_gui->setContentSubTabs();
1151 if ($this->container_obj->getType() ==
'crs') {
1155 $course_ref_id = $tree->checkForParentType($this->container_obj->getRefId(),
'crs');
1163 return gmmktime(
$time[
'h'],
$time[
'm'], 0, $date[
'm'], $date[
'd'], $date[
'y']);
1168 return array(
'y' =>
date(
'Y', $a_unix_time),
1169 'm' =>
date(
'm', $a_unix_time),
1170 'd' =>
date(
'd', $a_unix_time));
1175 return array(
'h' =>
date(
'G', $a_unix_time),
1176 'm' =>
date(
'i', $a_unix_time),
1177 's' =>
date(
's', $a_unix_time));
1185 $path_arr = $tree->getPathFull($a_ref_id, $this->course_obj->getRefId());
1187 foreach ($path_arr as
$data) {
1191 $path .= $data[
'title'];
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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.
static getCmdSide()
Get Column Side of Current Command.
static _getTypicalLearningTimeSeconds($a_rbac_id, $a_obj_id=0)
setColumnSettings($column_gui)
__renderItem($item, $level)
view()
Output course content.
getRightColumnHTML()
Display right column.
__editAdvancedUserTimings()
static getTimingsItems($a_container_ref_id)
Get (sub) item data for timings view (no session material, no side blocks)
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false)
Format a date public.
static getItem($a_ref_id)
Get item data.
setValue($a_value)
Set Value.
const TIMINGS_DEACTIVATED
__showUserAcceptanceTable()
__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...
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) ...
if(isset($_POST['submit'])) $form
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)
date( 'd-M-Y', $objPHPExcel->getProperties() ->getCreated())
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
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
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.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static getScreenMode()
Get Screen Mode for current command.
__construct($container_gui_obj)
Constructor public.
setPlanedStartingTime($a_time)
This class represents a text area property in a property form.
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)
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
__renderUserItem($item, $level)
Class ilObjectActivation.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")