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()))
53 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$ilErr->WARNING);
60 $this->tabs_gui->setTabActive(
'view_content');
61 $cmd = $this->ctrl->getCmd();
63 switch($this->ctrl->getNextClass($this))
65 case 'ilcoursearchivesgui':
69 case 'ilcourseobjectivepresentationgui':
74 $ilCtrl->saveParameterByClass(
"ilcolumngui",
"col_return");
75 $ilTabs->setSubTabActive(
"crs_content");
87 if(!$this->is_tutor = $ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()) and
88 $this->course_obj->isArchived())
95 if((!$this->is_tutor and
96 $this->container_obj->getType() ==
'crs' and
97 $this->container_obj->enabledObjectiveView()) ||
98 $_GET[
"col_return"] ==
"objectives")
100 $this->use_objective_presentation =
true;
121 if(
$_SESSION[
'crs_timings_panel'][$this->course_obj->getId()])
123 return 'editTimings';
125 if($ilAccess->checkAccess(
'write',
'',$this->container_obj->getRefId()))
129 if($this->container_obj->getType() ==
'crs' and
132 return 'editUserTimings';
139 include_once
'Modules/Course/classes/class.ilCourseObjectivePresentationGUI.php';
141 $this->ctrl->setReturn($this,
'');
144 if(!$this->ctrl->getNextClass())
146 $this->ctrl->setCmdClass(get_class($objectives_gui));
148 $this->ctrl->forwardCommand($objectives_gui);
154 include_once
'Modules/Course/classes/class.ilCourseArchivesGUI.php';
156 $this->ctrl->setReturn($this,
'');
158 $this->ctrl->forwardCommand($archives_gui);
160 $this->tabs_gui->setTabActive(
'view_content');
161 $this->tabs_gui->setSubTabActive(
'crs_archives');
168 include_once
'./Modules/Course/classes/class.ilCourseStart.php';
172 if($ilAccess->checkAccess(
'write',
'',$this->course_obj->getRefId()))
176 $this->start_obj =
new ilCourseStart($this->course_obj->getRefId(),$this->course_obj->getId());
177 if(count($this->start_obj->getStartObjects()) and !$this->start_obj->allFullfilled($ilUser->getId()))
186 include_once
'./Modules/Course/classes/class.ilCourseLMHistory.php';
187 include_once
'./Services/Repository/classes/class.ilRepositoryExplorer.php';
188 include_once
'./Services/Link/classes/class.ilLink.php';
192 $this->tabs_gui->setSubTabActive(
'crs_content');
194 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.crs_start_view.html",
'Modules/Course');
195 $this->tpl->setVariable(
"INFO_STRING",$this->lng->txt(
'crs_info_start'));
196 $this->tpl->setVariable(
"TBL_TITLE_START",$this->lng->txt(
'crs_table_start_objects'));
197 $this->tpl->setVariable(
"HEADER_NR",$this->lng->txt(
'crs_nr'));
198 $this->tpl->setVariable(
"HEADER_DESC",$this->lng->txt(
'description'));
199 $this->tpl->setVariable(
"HEADER_EDITED",$this->lng->txt(
'crs_objective_accomplished'));
202 $lm_continue =&
new ilCourseLMHistory($this->course_obj->getRefId(),$ilUser->getId());
206 foreach($this->start_obj->getStartObjects() as $start)
208 $obj_id = $ilObjDataCache->lookupObjId($start[
'item_ref_id']);
209 $ref_id = $start[
'item_ref_id'];
210 $type = $ilObjDataCache->lookupType(
$obj_id);
216 $obj_frame = $obj_frame ? $obj_frame :
'';
219 $obj_frame = $type ==
'tst' ?
'' : $obj_frame;
223 if($ilAccess->checkAccess(
'read',
'',
$ref_id))
225 $this->tpl->setCurrentBlock(
"start_read");
226 $this->tpl->setVariable(
"READ_TITLE_START",$ilObjDataCache->lookupTitle(
$obj_id));
227 $this->tpl->setVariable(
"READ_TARGET_START",$obj_frame);
228 $this->tpl->setVariable(
"READ_LINK_START", $obj_link.
'&crs_show_result='.$this->course_obj->getRefId());
229 $this->tpl->parseCurrentBlock();
233 $this->tpl->setCurrentBlock(
"start_visible");
234 $this->tpl->setVariable(
"VISIBLE_LINK_START",$ilObjDataCache->lookupTitle(
$obj_id));
235 $this->tpl->parseCurrentBlock();
239 if(isset($continue_data[
$ref_id]))
241 $this->tpl->setCurrentBlock(
"link");
242 $this->tpl->setVariable(
"LINK_HREF",
ilLink::_getLink($ref_id,
'',array(
'obj_id',
243 $continue_data[$ref_id][
'lm_page_id'])));
244 #$this->tpl->setVariable("CONTINUE_LINK_TARGET",$target);
245 $this->tpl->setVariable(
"LINK_NAME",$this->lng->txt(
'continue_work'));
246 $this->tpl->parseCurrentBlock();
250 if(!$ilUser->isDesktopItem($ref_id,$type) and
251 $this->course_obj->getAboStatus())
253 if ($ilAccess->checkAccess(
'read',
'',$ref_id))
255 $this->tpl->setCurrentBlock(
"link");
256 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'item_ref_id',$ref_id);
257 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'item_id',$ref_id);
258 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'type',$type);
260 $this->tpl->setVariable(
"LINK_HREF",$this->ctrl->getLinkTarget($this->container_gui,
'addToDesk'));
261 $this->tpl->setVariable(
"LINK_NAME", $this->lng->txt(
"to_desktop"));
262 $this->tpl->parseCurrentBlock();
265 elseif($this->course_obj->getAboStatus())
267 $this->tpl->setCurrentBlock(
"link");
268 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'item_ref_id',$ref_id);
269 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'item_id',$ref_id);
270 $this->ctrl->setParameterByClass(get_class($this->container_gui),
'type',$type);
272 $this->tpl->setVariable(
"LINK_HREF",$this->ctrl->getLinkTarget($this->container_gui,
'removeFromDesk'));
273 $this->tpl->setVariable(
"LINK_NAME", $this->lng->txt(
"unsubscribe"));
274 $this->tpl->parseCurrentBlock();
279 if(strlen($ilObjDataCache->lookupDescription(
$obj_id)))
281 $this->tpl->setCurrentBlock(
"start_description");
282 $this->tpl->setVariable(
"DESCRIPTION_START",$ilObjDataCache->lookupDescription(
$obj_id));
283 $this->tpl->parseCurrentBlock();
287 if($this->start_obj->isFullfilled($ilUser->getId(),
$ref_id))
289 $accomplished =
'accomplished';
293 $accomplished =
'not_accomplished';
295 $this->tpl->setCurrentBlock(
"start_row");
297 $this->tpl->setVariable(
"EDITED_ALT",$this->lng->txt(
'crs_objective_'.$accomplished));
298 $this->tpl->setVariable(
"ROW_CLASS",
'option_value');
299 $this->tpl->setVariable(
"ROW_CLASS_CENTER",
'option_value_center');
300 $this->tpl->setVariable(
"OBJ_NR_START",++$counter.
'.');
301 $this->tpl->parseCurrentBlock();
312 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
316 $this->container_obj->getType(), $this->container_obj->getRefId(),
322 if (!$this->no_right_column)
335 if ($ilCtrl->getNextClass() ==
"ilcourseobjectivepresentationgui")
337 $ilCtrl->setParameterByClass(
"ilcolumngui",
"col_return",
"objectives");
339 $ilCtrl->saveParameterByClass(
"ilcolumngui",
"col_return");
344 include_once(
"Services/Block/classes/class.ilColumnGUI.php");
354 if ($ilCtrl->getNextClass() ==
"ilcolumngui" &&
359 $html = $ilCtrl->forwardCommand($column_gui);
363 if (!$ilCtrl->isAsynch())
365 $html = $ilCtrl->getHTML($column_gui);
374 global $ilAccess,
$lng;
376 $column_gui->setRepositoryMode(
true);
377 $column_gui->setEnableEdit(
false);
378 $column_gui->setBlockProperty(
"news",
"title",
379 $lng->txt(
"crs_news"));
381 include_once
"Services/Object/classes/class.ilObjectActivation.php";
382 $grouped_items = array();
385 $grouped_items[$item[
"type"]][] = $item;
388 $column_gui->setRepositoryItems($grouped_items);
389 if ($ilAccess->checkAccess(
"write",
"", $this->container_obj->getRefId()))
391 $column_gui->setEnableEdit(
true);
395 if ($this->is_tutor &&
396 $this->container_gui->isActiveAdministrationPanel())
398 $column_gui->setEnableMovement(
true);
404 $column_gui->setBlockProperty(
"news",
"settings",
true);
406 $column_gui->setBlockProperty(
"news",
"default_visibility_option",
true);
407 $column_gui->setBlockProperty(
"news",
"hide_news_block_option",
true);
410 if ($this->container_gui->isActiveAdministrationPanel())
412 $column_gui->setAdminCommands(
true);
424 include_once(
"Services/Block/classes/class.ilColumnGUI.php");
429 if (!$ilCtrl->isAsynch())
439 $html = $ilCtrl->forwardCommand($column_gui);
446 $html = $ilCtrl->forwardCommand($column_gui);
451 if (
$_GET[
"col_return"] ==
"objectives")
454 include_once
'Modules/Course/classes/class.ilCourseObjectivePresentationGUI.php';
455 $this->ctrl->setReturn($this,
'');
457 $this->ctrl->getHTML($objectives_gui);
461 $this->getDefaultView();
473 include_once
'Services/MetaData/classes/class.ilMDEducational.php';
474 include_once
'./Services/Link/classes/class.ilLink.php';
476 $this->lng->loadLanguageModule(
'meta');
478 if(!$ilAccess->checkAccess(
'write',
'',$this->container_obj->getRefId()))
480 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),$ilErr->WARNING);
483 $this->tabs_gui->setSubTabActive(
'timings_timings');
485 include_once
'Services/Object/classes/class.ilObjectActivation.php';
488 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_edit_items.html',
'Modules/Course');
489 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
491 $this->tpl->setVariable(
"HEADER_ALT",$this->lng->txt(
'crs_materials'));
492 $this->tpl->setVariable(
"BLOCK_HEADER_CONTENT",$this->lng->txt(
'edit_timings_list'));
493 $this->tpl->setVariable(
"TXT_TITLE",$this->lng->txt(
'title'));
496 $this->tpl->setVariable(
"TXT_DURATION",$this->lng->txt(
'crs_timings_time_frame'));
497 $this->tpl->setVariable(
"TXT_INFO_DURATION",$this->lng->txt(
'crs_timings_in_days'));
499 $this->tpl->setVariable(
"TXT_START_END",$this->lng->txt(
'crs_timings_short_start_end'));
500 $this->tpl->setVariable(
"TXT_INFO_START_END",$this->lng->txt(
'crs_timings_start_end_info'));
502 $this->tpl->setVariable(
"TXT_CHANGEABLE",$this->lng->txt(
'crs_timings_short_changeable'));
504 $this->tpl->setVariable(
"TXT_INFO_LIMIT",$this->lng->txt(
'crs_timings_from_until'));
505 $this->tpl->setVariable(
"TXT_LIMIT",$this->lng->txt(
'crs_timings_short_limit_start_end'));
506 $this->tpl->setVariable(
"TXT_ACTIVE",$this->lng->txt(
'crs_timings_short_active'));
507 $this->tpl->setVariable(
"TXT_INFO_ACTIVE",$this->lng->txt(
'crs_timings_info_active'));
510 foreach($this->cont_arr as $item)
512 if($item[
'type'] ==
'itgr')
517 $item_prefix =
"item[$item[ref_id]]";
518 $item_change_prefix =
"item_change[$item[ref_id]]";
519 $item_active_prefix =
"item_active[$item[ref_id]]";
521 if($item[
'type'] ==
'grp' or
522 $item[
'type'] ==
'fold')
524 $this->tpl->setVariable(
"TITLE_LINK",
ilLink::_getLink($item[
'ref_id'],$item[
'type']));
526 $this->tpl->setVariable(
"TITLE_LINK_NAME",$item[
'title']);
530 $this->tpl->setVariable(
"TITLE",$item[
'title']);
533 if(strlen($item[
'description']))
535 $this->tpl->setCurrentBlock(
"item_description");
536 $this->tpl->setVariable(
"DESC",$item[
'description']);
537 $this->tpl->parseCurrentBlock();
542 $this->tpl->setCurrentBlock(
"tlt");
543 $this->tpl->setVariable(
"TXT_TLT",$this->lng->txt(
'meta_typical_learning_time'));
545 $this->tpl->parseCurrentBlock();
548 $this->tpl->setCurrentBlock(
"container_standard_row");
551 if(is_array(
$_POST[
'item'][
"$item[ref_id]"][
'sug_start']))
553 $start = $this->
__toUnix(
$_POST[
'item'][
"$item[ref_id]"][
'sug_start']);
557 $start = $item[
'suggestion_start'];
559 $end = $item[
'suggestion_end'];
561 $this->tpl->setVariable(
"SUG_START",
563 $date[
'y'],$date[
'm'],$date[
'd'],date(
'Y',time()),
false));
565 $this->tpl->setVariable(
"NAME_DURATION_A",$item_prefix.
"[duration_a]");
566 if(isset(
$_POST[
'item'][
"$item[ref_id]"][
'duration_a']))
568 $this->tpl->setVariable(
"VAL_DURATION_A",abs(
$_POST[
'item'][
"$item[ref_id]"][
'duration_a']));
572 $this->tpl->setVariable(
"VAL_DURATION_A",intval(($end-$start)/(60*60*24)));
578 if(is_array(
$_POST[
'item'][
"$item[ref_id]"][
'lim_end']))
580 $end = $this->
__toUnix(
$_POST[
'item'][
"$item[ref_id]"][
'lim_end']);
584 $end = $item[
'latest_end'];
588 $this->tpl->setVariable(
"LIM_END",
590 $date[
'y'],$date[
'm'],$date[
'd'],date(
'Y',time()),
false));
592 $this->tpl->setVariable(
"NAME_CHANGE",$item_change_prefix.
"[change]");
593 $this->tpl->setVariable(
"NAME_ACTIVE",$item_active_prefix.
"[active]");
597 $change =
$_POST[
'item_change'][
"$item[ref_id]"][
'change'];
598 $active =
$_POST[
'item_active'][
"$item[ref_id]"][
'active'];
602 $change = $item[
'changeable'];
606 $this->tpl->setVariable(
"CHECKED_ACTIVE",$active ?
'checked="checked"' :
'');
607 $this->tpl->setVariable(
"CHECKED_CHANGE",$change ?
'checked="checked"' :
'');
609 if(isset($this->failed[
"$item[ref_id]"]))
611 $this->tpl->setVariable(
"ROWCLASS",
'tblrowmarked');
617 $this->tpl->parseCurrentBlock();
622 $this->tpl->setVariable(
"SELECT_ALL",$this->lng->txt(
'select_all'));
624 $this->tpl->setVariable(
"BTN_SAVE",$this->lng->txt(
'save'));
625 $this->tpl->setVariable(
"BTN_CANCEL",$this->lng->txt(
'cancel'));
633 include_once
'Modules/Course/classes/Timings/class.ilTimingAccepted.php';
634 $accept_obj =
new ilTimingAccepted($this->course_obj->getId(),$ilUser->getId());
636 $this->tpl->setVariable(
"REMARK",$accept_obj->getRemark());
637 $this->tpl->setVariable(
"ACCEPT_CHECKED",$accept_obj->isAccepted() ?
'checked="checked"' :
'');
638 $this->tpl->setVariable(
"TUTOR_CHECKED",$accept_obj->isVisible() ?
'checked="checked"' :
'');
640 $this->tpl->setVariable(
"TIMING_ACCEPT",$this->lng->txt(
'timing_accept_table'));
641 $this->tpl->setVariable(
"TXT_ACCEPT",$this->lng->txt(
'timing_user_accept'));
642 $this->tpl->setVariable(
"TXT_REMARK",$this->lng->txt(
'timing_remark'));
643 $this->tpl->setVariable(
"TXT_TUTOR",$this->lng->txt(
'timing_tutor_visible'));
644 $this->tpl->setVariable(
"TXT_BTN_UPDATE",$this->lng->txt(
'save'));
650 include_once
'Modules/Course/classes/Timings/class.ilTimingAccepted.php';
651 $accept_obj =
new ilTimingAccepted($this->course_obj->getId(),$ilUser->getId());
654 $accept_obj->accept(
$_POST[
'accepted']);
655 $accept_obj->setVisible(
$_POST[
'tutor']);
656 $accept_obj->update();
663 if(
$_SESSION[
'crs_timings_panel'][$this->course_obj->getId()])
669 if(!$ilAccess->checkAccess(
'read',
'',$this->container_obj->getRefId()))
671 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_read'),$ilErr->WARNING);
673 $this->tabs_gui->setSubTabActive(
'timings_timings');
677 include_once
'Services/Object/classes/class.ilObjectActivation.php';
690 $this->ctrl->returnToParent($this);
695 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_user_timings.html',
'Modules/Course');
696 $this->tabs_gui->clearSubTabs();
697 $this->tabs_gui->setTabActive(
'members');
699 if(!
$_GET[
'member_id'])
702 $this->ctrl->returnToParent($this);
707 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
708 $this->tpl->setCurrentBlock(
"btn_cell");
709 $this->tpl->setVariable(
"BTN_LINK",$this->ctrl->getLinkTarget($this,
'returnToMembers'));
710 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"back"));
711 $this->tpl->parseCurrentBlock();
713 include_once
'Modules/Course/classes/Timings/class.ilTimingAccepted.php';
716 if($usr_accepted->isAccepted())
719 $this->tpl->setVariable(
"ACC_ALT",$this->lng->txt(
'timing_accepted'));
724 $this->tpl->setVariable(
"ACC_ALT",$this->lng->txt(
'timing_not_accepted'));
726 if($usr_accepted->isVisible() and strlen($usr_accepted->getRemark()))
728 $this->tpl->setVariable(
"REMARK",nl2br($usr_accepted->getRemark()));
732 $this->tpl->setVariable(
"REMARK",$this->lng->txt(
'not_available'));
735 $this->tpl->setVariable(
"TIMING_ACCEPT",$this->lng->txt(
'timing_accept_table'));
736 $this->tpl->setVariable(
"TXT_ACCEPTED",$this->lng->txt(
'timing_user_accepted'));
737 $this->tpl->setVariable(
"TXT_REMARK",$this->lng->txt(
'timing_remark'));
740 $this->tpl->setVariable(
"HEADER_ALT",$this->lng->txt(
'obj_usr'));
741 $this->tpl->setVariable(
"TABLE_HEADER",$this->lng->txt(
'timings_of'));
743 $this->tpl->setVariable(
"USER_NAME",$name[
'lastname'].
', '.$name[
'firstname']);
745 $this->tpl->setVariable(
"TXT_TITLE",$this->lng->txt(
'title'));
746 $this->tpl->setVariable(
"TXT_START_END",$this->lng->txt(
'crs_timings_short_start_end'));
747 $this->tpl->setVariable(
"TXT_INFO_START_END",$this->lng->txt(
'crs_timings_start_end_info'));
748 $this->tpl->setVariable(
"TXT_CHANGED",$this->lng->txt(
'crs_timings_changed'));
749 $this->tpl->setVariable(
"TXT_OWN_PRESETTING",$this->lng->txt(
'crs_timings_planed_start'));
750 $this->tpl->setVariable(
"TXT_INFO_OWN_PRESETTING",$this->lng->txt(
'crs_timings_from_until'));
752 include_once
'Services/Object/classes/class.ilObjectActivation.php';
754 foreach($items as $item)
766 include_once
'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
767 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
769 $this->lng->loadLanguageModule(
'meta');
772 for($i = 0;$i < $level;$i++)
774 $this->tpl->touchBlock(
'start_indent');
775 $this->tpl->touchBlock(
'end_indent');
777 if(strlen($item[
'description']))
779 $this->tpl->setCurrentBlock(
"item_description");
780 $this->tpl->setVariable(
"DESC",$item[
'description']);
781 $this->tpl->parseCurrentBlock();
785 $this->tpl->setCurrentBlock(
"tlt");
786 $this->tpl->setVariable(
"TXT_TLT",$this->lng->txt(
'meta_typical_learning_time'));
788 $this->tpl->parseCurrentBlock();
791 $this->tpl->setCurrentBlock(
"title_plain");
792 $this->tpl->setVariable(
"TITLE",$item[
'title']);
793 $this->tpl->parseCurrentBlock();
795 $this->tpl->setCurrentBlock(
"container_standard_row");
797 $this->tpl->setVariable(
"ROWCLASS",
ilUtil::switchColor($this->counter++,
'tblrow1',
'tblrow2'));
798 #$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_'.$item['type'].'.png'));
800 $this->tpl->setVariable(
"TYPE_ALT_IMG",$this->lng->txt(
'obj_'.$item[
'type']));
810 if($usr_planed->getPlanedStartingTime())
812 $start = $usr_planed->getPlanedStartingTime();
816 $start = $item[
'suggestion_start'];
820 if($usr_planed->getPlanedEndingTime())
822 $end = $usr_planed->getPlanedEndingTime();
826 $end = $item[
'suggestion_end'];
828 if($start != $item[
'suggestion_start'] or $end != $item[
'suggestion_end'])
831 $this->tpl->setVariable(
"OK_ALT",$this->lng->txt(
'crs_timings_changed'));
836 $this->tpl->setVariable(
"OK_ALT",$this->lng->txt(
'crs_timings_not_changed'));
841 $this->tpl->parseCurrentBlock();
857 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_usr_edit_timings_adv.html',
'Modules/Course');
861 $this->tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
863 $this->tpl->setVariable(
"HEADER_ALT",$this->lng->txt(
'obj_crs'));
864 $this->tpl->setVariable(
"BLOCK_HEADER_CONTENT",$this->lng->txt(
'timings_usr_edit'));
866 if(!
$_SESSION[
'crs_timings_user_hidden'])
868 $this->tpl->setVariable(
"SHOW_HIDE_TEXT",$this->lng->txt(
'show_details'));
869 $this->ctrl->setParameter($this,
'show_details',1);
870 $this->tpl->setVariable(
"SHOW_HIDE_LINK",$this->ctrl->getLinkTarget($this,
'editUserTimings'));
874 $this->tpl->setVariable(
"SHOW_HIDE_TEXT",$this->lng->txt(
'hide_details'));
875 $this->ctrl->setParameter($this,
'show_details',0);
876 $this->tpl->setVariable(
"SHOW_HIDE_LINK",$this->ctrl->getLinkTarget($this,
'editUserTimings'));
878 $this->ctrl->clearParameters($this);
879 $this->tpl->setVariable(
"TXT_TITLE",$this->lng->txt(
'title'));
880 $this->tpl->setVariable(
"TXT_START_END",$this->lng->txt(
'crs_timings_short_start_end'));
881 $this->tpl->setVariable(
"TXT_INFO_START_END",$this->lng->txt(
'crs_timings_start_end_info'));
883 $this->tpl->setVariable(
"TXT_LIMIT",$this->lng->txt(
'crs_timings_short_limit_start_end'));
884 $this->tpl->setVariable(
"TXT_INFO_LIMIT",$this->lng->txt(
'crs_timings_from_until'));
886 $this->tpl->setVariable(
"TXT_OWN_PRESETTING",$this->lng->txt(
'crs_timings_planed_start'));
887 $this->tpl->setVariable(
"TXT_INFO_OWN_PRESETTING",$this->lng->txt(
'crs_timings_start_end_info'));
889 $this->tpl->setVariable(
"TXT_DURATION",$this->lng->txt(
'crs_timings_time_frame'));
890 $this->tpl->setVariable(
"TXT_INFO_DURATION",$this->lng->txt(
'crs_timings_in_days'));
892 $this->tpl->setVariable(
"TXT_BTN_UPDATE",$this->lng->txt(
'save'));
893 $this->tpl->setVariable(
"TXT_CANCEL",$this->lng->txt(
'cancel'));
895 include_once
'Services/Object/classes/class.ilObjectActivation.php';
899 foreach($sorted_items as $item)
901 switch($item[
'type'])
915 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.crs_usr_edit_timings.html',
'Modules/Course');
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'])
926 $this->tpl->setVariable(
"SHOW_HIDE_TEXT",$this->lng->txt(
'show_details'));
927 $this->ctrl->setParameter($this,
'show_details',1);
928 $this->tpl->setVariable(
"SHOW_HIDE_LINK",$this->ctrl->getLinkTarget($this,
'editUserTimings'));
932 $this->tpl->setVariable(
"SHOW_HIDE_TEXT",$this->lng->txt(
'hide_details'));
933 $this->ctrl->setParameter($this,
'show_details',0);
934 $this->tpl->setVariable(
"SHOW_HIDE_LINK",$this->ctrl->getLinkTarget($this,
'editUserTimings'));
936 $this->ctrl->clearParameters($this);
938 $this->tpl->setVariable(
"BLOCK_HEADER_CONTENT",$this->lng->txt(
'timings_timings'));
939 $this->tpl->setVariable(
"TXT_TITLE",$this->lng->txt(
'title'));
940 $this->tpl->setVariable(
"TXT_START",$this->lng->txt(
'crs_timings_sug_begin'));
941 $this->tpl->setVariable(
"TXT_END",$this->lng->txt(
'crs_timings_sug_end'));
943 include_once
'Services/Object/classes/class.ilObjectActivation.php';
947 foreach($sorted_items as $item)
949 switch($item[
'type'])
965 include_once
'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
966 include_once
'./Services/Link/classes/class.ilLink.php';
967 include_once
'./Services/MetaData/classes/class.ilMDEducational.php';
969 if(!$ilAccess->checkAccess(
'visible',
'',$item[
'ref_id']))
974 $this->lng->loadLanguageModule(
'meta');
976 $usr_planed =
new ilTimingPlaned($item[
'ref_id'],$ilUser->getId());
978 for($i = 0;$i < $level;$i++)
980 $this->tpl->touchBlock(
'start_indent');
981 $this->tpl->touchBlock(
'end_indent');
983 if(strlen($item[
'description']))
985 $this->tpl->setCurrentBlock(
"item_description");
986 $this->tpl->setVariable(
"DESC",$item[
'description']);
987 $this->tpl->parseCurrentBlock();
991 $this->tpl->setCurrentBlock(
"tlt");
992 $this->tpl->setVariable(
"TXT_TLT",$this->lng->txt(
'meta_typical_learning_time'));
994 $this->tpl->parseCurrentBlock();
997 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();
1006 $this->tpl->setCurrentBlock(
"title_plain");
1007 $this->tpl->setVariable(
"TITLE",$item[
'title']);
1008 $this->tpl->parseCurrentBlock();
1010 $this->tpl->setCurrentBlock(
"container_standard_row");
1012 if(isset($this->invalid[
"$item[ref_id]"]))
1014 $this->tpl->setVariable(
"ROWCLASS",
'tblrowmarked');
1018 $this->tpl->setVariable(
"ROWCLASS",
ilUtil::switchColor($this->counter++,
'tblrow1',
'tblrow2'));
1020 #$this->tpl->setVariable("TYPE_IMG",ilUtil::getImagePath('icon_'.$item['type'].'.png'));
1022 $this->tpl->setVariable(
"TYPE_ALT_IMG",$this->lng->txt(
'obj_'.$item[
'type']));
1031 if($item[
'changeable'])
1033 $item_prefix =
"item[".$item[
'ref_id'].
']';
1035 if(is_array(
$_POST[
'item'][
"$item[ref_id]"][
'own_start']))
1037 #echo "Start post<br>";
1038 $start = $this->
__toUnix(
$_POST[
'item'][
"$item[ref_id]"][
'own_start']);
1040 elseif($usr_planed->getPlanedStartingTime())
1042 #echo "Own start<br>";
1043 $start = $usr_planed->getPlanedStartingTime();
1047 #echo "Empfehlung start<br>";
1048 $start = $item[
'suggestion_start'];
1052 $this->tpl->setVariable(
"OWN_START",
1054 $date[
'y'],$date[
'm'],$date[
'd'],date(
'Y',time()),
false));
1056 if($usr_planed->getPlanedEndingTime())
1058 #echo "Own End<br>";
1059 $end = $usr_planed->getPlanedEndingTime();
1063 #echo "Empfehlung end<br>";
1064 $end = $item[
'suggestion_end'];
1067 $this->tpl->setVariable(
"NAME_DURATION",$item_prefix.
"[duration]");
1070 if(isset(
$_POST[
'item'][
"$item[ref_id]"][
'duration']))
1072 $this->tpl->setVariable(
"VAL_DURATION",
$_POST[
'item'][
"$item[ref_id]"][
'duration']);
1076 $this->tpl->setVariable(
"VAL_DURATION",intval(($end - $start) / (60 * 60 * 24)));
1082 $this->tpl->parseCurrentBlock();
1084 if(!
$_SESSION[
'crs_timings_user_hidden'])
1099 if(!$ilAccess->checkAccess(
'write',
'',$this->container_obj->getRefId()))
1104 if(!
$_SESSION[
'crs_timings_panel'][$this->course_obj->getId()])
1106 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
1107 $this->tpl->setCurrentBlock(
"btn_cell");
1108 $this->tpl->setVariable(
"BTN_LINK",$this->ctrl->getLinkTarget($this,
'timingsOn'));
1109 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"timings_timings_on"));
1110 $this->tpl->parseCurrentBlock();
1114 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
1115 $this->tpl->setCurrentBlock(
"btn_cell");
1116 $this->tpl->setVariable(
"BTN_LINK",$this->ctrl->getLinkTarget($this,
'timingsOff'));
1117 $this->tpl->setVariable(
"BTN_TXT",$this->lng->txt(
"timings_timings_off"));
1118 $this->tpl->parseCurrentBlock();
1125 $_SESSION[
'crs_timings_panel'][$this->course_obj->getId()] = 1;
1127 $ilTabs->clearSubTabs();
1135 $_SESSION[
'crs_timings_panel'][$this->course_obj->getId()] = 0;
1137 $ilTabs->clearSubTabs();
1145 global
$ilUser,$ilObjDataCache;
1146 include_once
'Modules/Course/classes/Timings/class.ilTimingPlaned.php';
1149 $this->invalid = array();
1155 if(isset(
$data[
'duration']))
1157 $data[
'own_start'][
'd'] +=
$data[
'duration'];
1158 $tmp_planed->setPlanedEndingTime($this->
__toUnix(
$data[
'own_start'],array(
'h' => 23,
'm' => 55)));
1162 $tmp_planed->setPlanedEndingTime($this->
__toUnix(
$data[
'own_start']),array(
'h' => 23,
'm' => 55));
1164 if(!$tmp_planed->validate())
1166 $this->invalid[
$ref_id] = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId(
$ref_id));
1168 $all_items[] = $tmp_planed;
1170 if(count($this->invalid))
1172 $message = $this->lng->txt(
'crs_timings_update_error');
1173 $message .= (
"<br />".$this->lng->txt(
'crs_materials').
': ');
1174 $message .= (implode(
',',$this->invalid));
1179 foreach($all_items as $new_item_obj)
1181 $new_item_obj->update();
1198 $item[
'suggestion_start'] = $this->
__toUnix(
$_POST[
'item'][$obj_id][
'sug_start']);
1199 if(isset(
$_POST[
'item'][$obj_id][
'sug_end']))
1202 $item[
'suggestion_end'] = $this->
__toUnix(
$_POST[
'item'][$obj_id][
'sug_end']);
1204 $item[
'earliest_start'] = $this->
__toUnix(
$_POST[
'item'][$obj_id][
'lim_start']);
1205 $item[
'latest_end'] = $this->
__toUnix(
$_POST[
'item'][$obj_id][
'lim_end']);
1208 $item[
'duration_a'] =
$_POST[
'item'][
$obj_id][
'duration_a'];
1209 $item[
'duration_b'] =
$_POST[
'item'][
$obj_id][
'duration_b'];
1216 include_once
'Services/Object/classes/class.ilObjectActivation.php';
1220 if(!$ilAccess->checkAccess(
'write',
'',$this->container_obj->getRefId()))
1222 $ilErr->raiseError($this->lng->txt(
'msg_no_perm_write'),$ilErr->WARNING);
1224 $this->failed = array();
1228 $all_items = array();
1235 $item_obj->setTimingType(
$_POST[
'item_active'][
$ref_id][
'active'] ?
1238 $item_obj->setTimingStart($old_data[
'timing_start']);
1239 $item_obj->setTimingEnd($old_data[
'timing_end']);
1240 $item_obj->setSuggestionStart($this->
__toUnix(
$data[
"sug_start"]));
1243 $data[
'sug_start'][
'd'] += abs(
$data[
'duration_a']);
1244 $item_obj->setSuggestionEnd($this->
__toUnix(
$data[
'sug_start'],array(
'h' => 23,
'm' => 55)));
1246 $item_obj->setEarliestStart(time());
1247 $item_obj->setLatestEnd($this->
__toUnix(
$data[
'lim_end'],array(
'h' => 23,
'm' => 55)));
1249 $item_obj->toggleVisible($old_data[
'visible']);
1250 $item_obj->toggleChangeable(
$_POST[
'item_change'][
$ref_id][
'change']);
1252 if(!$item_obj->validateActivation())
1254 $this->failed[
$ref_id] = $old_data[
'title'];
1256 $all_items[
$ref_id] =& $item_obj;
1260 if(count($this->failed))
1262 $message = $this->lng->txt(
'crs_timings_update_error');
1263 $message .= (
"<br />".$this->lng->txt(
'crs_materials').
': ');
1264 $message .= (implode(
',',$this->failed));
1271 foreach($all_items as
$ref_id => $item_obj_new)
1273 $item_obj_new->update(
$ref_id);
1282 if($this->container_obj->getType() ==
'crs')
1284 $this->container_gui->setContentSubTabs();
1292 if($this->container_obj->getType() ==
'crs')
1300 $course_ref_id = $tree->checkForParentType($this->container_obj->getRefId(),
'crs');
1308 return gmmktime($time[
'h'],$time[
'm'],0,$date[
'm'],$date[
'd'],$date[
'y']);
1313 return array(
'y' => date(
'Y',$a_unix_time),
1314 'm' => date(
'm',$a_unix_time),
1315 'd' => date(
'd',$a_unix_time));
1320 return array(
'h' => date(
'G',$a_unix_time),
1321 'm' => date(
'i',$a_unix_time),
1322 's' => date(
's',$a_unix_time));
1330 $path_arr = $tree->getPathFull($a_ref_id,$this->course_obj->getRefId());
1332 foreach($path_arr as
$data)
1338 $path .= $data[
'title'];